Close Button

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi,

I have a small .net cf app that does not exit when the close (x) button (in
the controlbox) is pressed. I understand why this may be the case, but how
can I intercept the call and quit the application? I have tried overriding
the OnClosing method, but this does not work. Any help would be greatly
appreciated.

Mark
 
Mark,

This is a frequently asked question because the default behavior is so
unexpected to desktop developers. If you want the close button to really
close your app, you need to set the form's MinimizeBox = false. Then instead
of an X you will get OK and the form will close and the code in OnClosing
will run. The X really only minimizes the app.
 
Back
Top