Hi,
When I am inside a thread, I cannot simply call Me.Close or I get cross threading error!
So I need to use some code like this and then call SetClose()
But this don't work for some reason I don't know, anyone can see something wrong with my code?
Thank you.
When I am inside a thread, I cannot simply call Me.Close or I get cross threading error!
So I need to use some code like this and then call SetClose()
Visual Basic:
Private Delegate Sub SetCloseCallback()
Private Sub SetClose()
If Me.InvokeRequired Then
Dim d As New SetCloseCallback(AddressOf SetClose)
Me.Invoke(d, New Object() {Me})
Else
Me.Close()
End If
End Sub
Thank you.