Thanks Tom.
My understanding is that ShowDialog() is blocking, in which case my
thread does not continue to run. Is that the case? If so, when my
cancel button is clicked, how do I exit the form so that a ShowDialog
returns to its invoking thread?
If I start a new thread do I have to worry about subsequently doing an
application.exi t? I'm a bit unclear on the notion of forms and what
thread/environment they execute in. In particular the workings of
application.run and exit are not clear.
Thanks again for your help.
On Tue, 02 Mar 2004 22:34:07 -0800, Tom Shelton <to*@mtogden.co m>
wrote:
On 2004-03-02, Richard Bell <rb********@ear thlink.net> wrote: I'm new to VB.net and have a multithreaded application that needs to
display a VB form with a cancel button. The thread that displays the
form needs to set a cancel flag if the button is pressed. It also
needs to look for a thread event that signals that other threads have
completed work. I'm a bit unsure of how to approach this problem.
If I show the form
fProgress.Show( )
it only partially displays (the cancle button is a 'hole') and it is
not active.
I'd appreciate any clues or examples.
Thanks
Richard...
Use fProgress.ShowD ialog() or on this thread call Application.Run to
start a message loop...
Dim t As New Thread(AddressO f ThreadProc)
t.Start
...
Private Sub ThreadProc()
Dim fProgress As New ProgressForm()
Application.Run (fProgress)
End Sub