Making a form to not close / Handling the click for closing eventin .NET 1.1

  • Thread starter Thread starter Ioannis Vranos
  • Start date Start date
I

Ioannis Vranos

Is there any way to make a form *not closing* when its X on the upper-right is clicked?

Is there any event for handling clicks on the X (e.g. to perform additional actions)?
 
Steve said:
Hi,

Have a look at:
http://msdn.microsoft.com/library/d...rmsFormClassOnClosingTopic.aspCancelEventArgs has a member called Cancel you can set to true. I don'tthink there's any direct handler you can attach to the 'X'.Steve"Ioannis Vranos" <[email protected]> wrote in messagenews:%[email protected]...> Is there any way to make a form *not closing* when its X on theupper-right is clicked?>> Is there any event for handling clicks on the X (e.g. to performadditional actions)?


A useful comment first. Your client apparently doesn't wrap a message when it sends it so
you had better press enter yourself so as to make it not appearing in only one long line.

Thanks for the link. However it doesn't load anything:


"Page Cannot Be Found

We apologize for the inconvenience, but the page you are seeking cannot be found in this
location.



If you are looking for a particular document, try the table of contents on the left or
look in one of the following areas:

* For content pertaining to a specific product or technology, try the MSDN Site Map.
* For Web Workshop content that has been migrated into the MSDN Library, try either
the Internet Development Entry Page or the Internet Development Index."



I also checked Form class and found no Cancel member of it.
 
Ioannis Vranos said:
OK thanks. It looks like this event handler provides whatever I need. Does
anyone know any shortcut way to create this, or have I to create this
event handler method and register it in the event manually?

You can obviously create it from the UI designer, but apart from that, I
don't know of a quicker way.

Steve
 
Ioannis Vranos said:
Yes, as usually. But where? When I double-click on X the Form_Load event
handler is created instead.

Go to the Properties windows, click the little lightning flash and find the
event you're interested in ( Behaviour -> Closing )

Steve
 
Steve said:
Go to the Properties windows, click the little lightning flash and find the
event you're interested in ( Behaviour -> Closing )

Thank you a lot.
 
Back
Top