vb2008 如何使用委派
請問各位大大在VB2008中委派是件的應用我該如何去使用我有查詢了一下資料寫了一個簡單的語法如下 Public Sub ChooseThreads(ByVal threadNumber As Integer) Select Case threadNumber Case 1 FactorialThread = New System.Threading.Thread(AddressOf work1) FactorialThread.Start() End Select End Sub Private Sub work1() DISP(TextBox1.Text) End Sub End Sub Public Function AddList(ByVal MSG As String) Display(MSG) End Function End Function Private Sub Button1_Click(ByVal sender As System.Object
ByVal e As System.EventArgs) Handles Button1.Click ChooseThreads(1) End Sub End Sub Delegate Sub SetMsg1(ByVal str As String) Private Sub Display(ByVal Displaystr As String) If Me.Label1.InvokeRequired Then Dim d As New SetMsg1(AddressOf Display) Me.Invoke(d
New Object() {Displaystr}) Else Me.Label1.Text = Displaystr End If End Sub Public Function DISP(ByVal item As Integer) Select Case item Case 1 Form1.AddList(
留言列表