472,145 Members | 1,443 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

prevent form from disposing

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
2 2243
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
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.

Similar topics

3 posts views Thread by Chris | last post: by
18 posts views Thread by Jan Nielsen | last post: by
reply views Thread by Amiram Korach | last post: by
6 posts views Thread by ahmad.humyn | last post: by
reply views Thread by Saiars | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.