1

the main form will create another form, the sub new form will create a Thread at loading. when the user close the sub form, I make event handler for closed form to abort its Thread.

but when the user try to close the main form the Thread of the sub form still running, how to abort it either the user close the sub form or the main form.

1 Answers1

1

Set the IsBackground() property of the Thread to True. This will allow it to be shutdown automatically when the application exits.

Idle_Mind
  • 38,363
  • 3
  • 29
  • 40