The Form1_Load
method is not the "main procedure", so the message box that you're displaying at the end of it is actually a lie. That's just an event handler method for the Form.Load
event, raised when your form is being displayed for the first time.
The "main procedure" is named Main
and is defined in a separate file (actually, in VB.NET, it's automatically generated by the compiler and not even visible to you by default). You can find more information on the Main
method in Microsoft's VB Programming Guide.
The Main
method is still running as long as your program is still running. After the Form1_Load
event handler method finishes, Form1
is still on the screen, so clearly your program hasn't closed yet. And since your program's main thread is still running, the BackgroundWorker
object's background thread is still running, asynchronously, just like you told it to.