How to stop a form closing

gesus

New member
Joined
Sep 6, 2004
Messages
4
Location
Amsterdam
Programming Experience
1-3
Hi All,

I just wander how I can stop a form closing.
This is what I want to do:

If a person presses the X menu button (in Win XP he's red, in the upper right corner) I want to display a messagebox if the user really wants to close that form.

And (ofcourse) if he selects "No" the form must stop closing.

Any one a idea how I could do this?

Thanks in Advance,
cheers
 

gesus

New member
Joined
Sep 6, 2004
Messages
4
Location
Amsterdam
Programming Experience
1-3
Hia ll,

Already solved this problem, was forgetting the
System.ComponentModel.CancelEventArgs

arguments..

Sorry..

gesus said:
Hi All,

I just wander how I can stop a form closing.
This is what I want to do:

If a person presses the X menu button (in Win XP he's red, in the upper right corner) I want to display a messagebox if the user really wants to close that form.

And (ofcourse) if he selects "No" the form must stop closing.

Any one a idea how I could do this?

Thanks in Advance,
cheers
 
Top Bottom