本文整理匯總了VB.NET中System.Windows.Forms.Control.BeginInvoke方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET Control.BeginInvoke方法的具體用法?VB.NET Control.BeginInvoke怎麽用?VB.NET Control.BeginInvoke使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。
在下文中一共展示了Control.BeginInvoke方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: InvokeDelegate
Delegate Sub InvokeDelegate()
Private Sub Invoke_Click(sender As Object, e As EventArgs)
myTextBox.BeginInvoke(New InvokeDelegate(AddressOf InvokeMethod))
End Sub
Public Sub InvokeMethod()
myTextBox.Text = "Executed the given delegate"
End Sub
示例2: MyDelegate
Delegate Sub MyDelegate(myControl As Label, myArg2 As String)
Private Sub Button_Click(sender As Object, e As EventArgs)
Dim myArray(1) As Object
myArray(0) = New Label()
myArray(1) = "Enter a Value"
myTextBox.BeginInvoke(New MyDelegate(AddressOf DelegateMethod), myArray)
End Sub
Public Sub DelegateMethod(myControl As Label, myCaption As String)
myControl.Location = New Point(16, 16)
myControl.Size = New Size(80, 25)
myControl.Text = myCaption
Me.Controls.Add(myControl)
End Sub