I ran into the problem of not being able to set a labels text from a background worker thread and came across the way to do it, I modified the sub (which only worked for a specified control) to try and make it work with any control I specify, but I get parameter count missmatch on Me.Invoke(d, New Object() {[text]})
Still unfamiliar and learning about how to do this, so any help would be appreciated.
VB.NET:
Delegate Sub SetTextCallback(ByVal [text] As String, ByVal lblControl As Label)
Private Sub SetLabelText(ByVal [text] As String, ByVal lblControl As Label)
If lblControl.InvokeRequired Then
Dim d As New SetTextCallback(AddressOf SetLabelText)
Me.Invoke(d, New Object() {[text]})
Else
lblControl.Text = [text]
End If
End Sub
Still unfamiliar and learning about how to do this, so any help would be appreciated.