I'm having a problem with threading forms, and i was wondering if someone can point me in the right direction.
I have two forms. 1 and 2.
on form 1 i have, form2 has no added code.
Private f As Form2
Private thrd As Threading.Thread
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
thrd = New Threading.Thread(New System.Threading.ThreadStart(AddressOf thrdStrt))
thrd.Priority = Threading.ThreadPriority.BelowNormal
thrd.Start()
End Sub
Private Sub thrdStrt()
f = New Form2
f.TopMost = True
f.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox(thrd.ThreadState.ToString)
End Sub
Now this works, but it works only for like a split second when the program runs. when i click on the button to check the state of the thread i get
The thread '<No Name>' (0x880) has exited with code 0 (0x0).
But I never stopped the thread i wanted it to keep running the second form. the only time it should stop is when the second form closes. How is this accomplished?
cheers.
john
--------------

I have two forms. 1 and 2.
on form 1 i have, form2 has no added code.
Private f As Form2
Private thrd As Threading.Thread
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
thrd = New Threading.Thread(New System.Threading.ThreadStart(AddressOf thrdStrt))
thrd.Priority = Threading.ThreadPriority.BelowNormal
thrd.Start()
End Sub
Private Sub thrdStrt()
f = New Form2
f.TopMost = True
f.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox(thrd.ThreadState.ToString)
End Sub
Now this works, but it works only for like a split second when the program runs. when i click on the button to check the state of the thread i get
The thread '<No Name>' (0x880) has exited with code 0 (0x0).
But I never stopped the thread i wanted it to keep running the second form. the only time it should stop is when the second form closes. How is this accomplished?
cheers.
john
--------------