Re: ShowDialiog not working
Thats because the two forms are displayed on separate threads. Create a subroutine that creates and displays the form using ShowDialog, and then do some cross-thread calls to invoke this method on the main thread. If you do not know how to perform cross-thread calls, take a look at this CodeBank submission by jmcilhinney.
Re: ShowDialiog not working
Thanks Athiest, after reading and a bit of googling, i figured out the problem. I was already passing the tcp events to the main thread, so i THOUGHT.
The problem code was:
Code:
If frmMain.InvokeRequired Then
frmMain.Invoke MySub
else
frmMain.MySub
End if
Which, apparently because it was on its own thread, it was creating a new class of frmMain, which didnt require an invoke. I fixed it with the following code
Code:
Dim MainFrm As frmMain = CType(Application.OpenForms(0), frmMain)
If MainFrm.InvokeRequired Then
MainFrm.Invoke MySub
else
MainFrm.MySub
End if