G
Garth
I ran into a small issue and I found a solution however it is cumbersome to use.
The problem and solution is describe within the MSDN article http://msdn2.microsoft.com/en-us/library/ms171728(d=ide).aspx
I would like to create one subroutine for all my textboxes and not one for each textbox, given the sample subroutine below, how can I add the textbox name into this subroutine?
Cumbersome Solution
Private Sub SetText(ByVal [text] As String)
' InvokeRequired required compares the thread ID of the
' calling thread to the thread ID of the creating thread.
' If these threads are different, it returns true.
If Me.tb_Netbios.InvokeRequired Then
Dim d As New SetTextCallback(AddressOf SetText)
Me.Invoke(d, New Object() {[text]})
Else
Me.tb_Netbios.Text = [text]
End If
End Sub
The problem and solution is describe within the MSDN article http://msdn2.microsoft.com/en-us/library/ms171728(d=ide).aspx
I would like to create one subroutine for all my textboxes and not one for each textbox, given the sample subroutine below, how can I add the textbox name into this subroutine?
Cumbersome Solution
Private Sub SetText(ByVal [text] As String)
' InvokeRequired required compares the thread ID of the
' calling thread to the thread ID of the creating thread.
' If these threads are different, it returns true.
If Me.tb_Netbios.InvokeRequired Then
Dim d As New SetTextCallback(AddressOf SetText)
Me.Invoke(d, New Object() {[text]})
Else
Me.tb_Netbios.Text = [text]
End If
End Sub