I will jump right into the question. Basically I have set up a program that requires multiple message pumps. However, when a form is in focus and a form that is on a different message pump calls BringToFront, it won't work because it's on a different message pump. Is there any way to fix this?
Damn, I cannot believe I forgot to add that... I am sorry ya'll! Language: VB.NET Sample of code:
Public Class Form1
Private Shared Test As New Form2
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Test.Invoke(Sub() Test.BringToFront())
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim T As New Threading.Thread(Sub()
Application.Run(Test)
End Sub)
T.Start()
End Sub
End Class
I use Invoke() because the form was created on a different thread.
First I press Button2, then I click Form1 again and try to bring Form2 to front using Button1.