Thread terminating instantly

  • Thread starter Thread starter Adam Honek
  • Start date Start date
A

Adam Honek

Hi all,

I'm launching a form in a new thread as follows below. The problem is the
form exits straight away.

How do I cause it to stay open until the form is closed?

The suspend won't work since I need to get UI events from the form controls.

Dim MyThread As System.Threading.Thread

MyThread = New System.Threading.Thread(AddressOf LaunchAccountsForm)

Call MyThread.Start()

Thanks,
Adam
 
Adam said:
Hi all,

I'm launching a form in a new thread as follows below. The problem is the
form exits straight away.

How do I cause it to stay open until the form is closed?

The suspend won't work since I need to get UI events from the form controls.

Dim MyThread As System.Threading.Thread

MyThread = New System.Threading.Thread(AddressOf LaunchAccountsForm)

Call MyThread.Start()

Thanks,
Adam

You should launch a UI element in a new thread.

But since you didn't show the code that you used to open the form we can
only guess. I'd guess you are using .Show instead of .Showdialog. But
like I said, you should look at how you are doing this because all your
UI elements should stay in the same thread.

Chris
 
Thanks a lot, yes showdialog did it.

It's just a config form that doesn't need to interact with the main form
hence
I'm not worried about joining the threads together.

Adam
 
Back
Top