In my Winform VB.NET application I am checking some fields. In case that one particular field is equal to true
I need to show message. Normally it would be like this:
If (myField) Then
MessageBox.Show("Something is wrong", "Warning", MessageBoxButtons.OK)
// continuing...
End If
This message must be shown modaly (user can return to main form only after clicking OK button). Problem is that I do not want the thread to wait for the clicking (just show the message and continue - do not wait for OK button).
My only idea is to show the message in background thread:
If (myField) Then
Dim t As Thread = New Thread(AddressOf ShowMyMessage)
t.Start()
// continuing...
End If
Private Sub ShowMyMessage()
MessageBox.Show("Something is wrong", "Warning", MessageBoxButtons.OK)
End Sub
But in this case the message is not shown modaly (user can return to main form and interact with it without clicking Ok button).
Any ideas?