Public Sub ChangeTitle(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.InvokeRequired Then
Dim d As New SetTextCallback(AddressOf ChangeTitle)
Invoke(d, New Object() {[text]})
Else
Me.Text = text
End If
End Sub