Close Button


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
 
Ad

Advertisements

G

Ginny Caughey [MVP]

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.
 
Ad

Advertisements


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

Top