[英]VB.NET Execute a Sub on a UserControl
我有很多要填充到表單上的用戶控件(在FlowLayoutPanel(flpContainer)內部)。
每個用戶控件都實現一個包含以下內容的接口:
ReadOnly Property Total1 As Dictionary(Of String, Double)
ReadOnly Property Total2 As Dictionary(Of String, Double)
ReadOnly Property Total3 As Dictionary(Of String, Double)
Sub DoCalculation()
Sub DoValidation()
Sub Clear()
有沒有一種方法,無論當前在窗體上加載哪個控件,我都可以調用例如flpContainer.controls(0).Clear(),而VB可以完成其余工作嗎?
嘗試投射到您的界面:
If TypeOf flpContainer.Controls(0) Is myInterface Then
DirectCast(flpContainer.Controls(0), myInterface).Clear()
End If
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.