By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,833 Members | 2,076 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,833 IT Pros & Developers. It's quick & easy.

prevent form from disposing

P: n/a
Hallo,

when a form is closed by clicking the closing button (cross in the right
upper corner of the form), it is also disposed. Can I prevent this, and
instead of closing (and disposing) the form, just hide the form? (it is
not the main form)

thanks,
Snuyt

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
maybe try this (not tested)

add a listener to the form closing event
in the event handling:
- set property Cancel of CancelEventArgs to true
- hide the form
I think that should do it

"Snuyt" <sn**********@skynet.be> wrote in message
news:40*********************@news.skynet.be...
Hallo,

when a form is closed by clicking the closing button (cross in the right
upper corner of the form), it is also disposed. Can I prevent this, and
instead of closing (and disposing) the form, just hide the form? (it is
not the main form)

thanks,
Snuyt

Nov 20 '05 #2

P: n/a
Have a look at the Closing event which implements CancelEventArgs

you can set cancel to true and simply hide the form...
"Snuyt" <sn**********@skynet.be> wrote in message
news:40*********************@news.skynet.be...
Hallo,

when a form is closed by clicking the closing button (cross in the right
upper corner of the form), it is also disposed. Can I prevent this, and
instead of closing (and disposing) the form, just hide the form? (it is
not the main form)

thanks,
Snuyt

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.