Hi,
You can use the Form.FormClosing event, to cancel the close, just set the
FormClosingEventArgs parameters Cancel property to true.
Hope You find this useful.
-Zsolt
"Eric T." <(E-Mail Removed)> az alábbiakat Ã*rta a következÅ‘
üzenetben news:4D94E108-A98E-4AA7-8C2D-(E-Mail Removed)...
> When the user presses Cancel on my form, I want there to be an opportunity
> to
> cancel the cancel, i.e. "Do you really want to abort the changes you've
> made". If the user presses N, I don't want it to exit. If the user
> presses
> Y, I set the DialogResult to Cancel and call this.Close(). I don't do
> anything if the user presses N, but the form closes anyways. How do I
> stop
> the form from closing?
> Thanks
> PS - The cancel button object is registered in the form as the
> CancelButton.
|