prevent form from disposing

  • Thread starter Thread starter Snuyt
  • Start date Start date
S

Snuyt

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
 
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
 
Have a look at the Closing event which implements CancelEventArgs

you can set cancel to true and simply hide the form...
 
Back
Top