PDA

Click to See Complete Forum and Search --> : Cancel a closing window


PorT_Alex
May 19th, 2004, 02:44 PM
Anyone knows how to cancel a closing window when a user closes it in the cross button in the caption bar.


I have an application and i want to get a confirmation before closing it.


When a user uses the cross button near the maximize and minimize button i want to get a message box with a cancel button to undo this close.


I tryed the closed event but the window still closes....

Any suggestions?

Thanks in advanced :)

PT Exorcist
May 19th, 2004, 03:30 PM
In the OnClose(or something like that) event just put
e.Cancel = true;
sabes quem sou? :P

PorT_Alex
May 19th, 2004, 08:00 PM
hehe ty, it works!!


Acho que sei quem és!!! Mas já n via esse nome à bues!!!
Tás a dominar c#!!!