How to determine reason for a form closing

  • Thread starter Thread starter Eidolon
  • Start date Start date
E

Eidolon

In "classic" VB, you could easily determine (on one of the events) why a
form was being closed. For example, "Workstation Shutdown", "App
termination", "X button clicked", etc. How can you do this in .NET?
Specifically i am looking to determine when the user clicks the X button
on the title bar, i want to override the behaviour of that button so that
instead of closing the form, it simply hides the form.
Is there any intrinsic way to do this in VB.NET as in VB6, or is it now
necessary to actually sub-class the window and watch for the associated
message of that button?

Thanks in advance,
- Aaron.
 
Used Mr. Tickles code below, and it worked fine (thread: System Command
Menu).
Thanks to him.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top