Aleksey,
I don't believe you should do this from the button click event. Rather,
you need to subscribe to the Closing event on your form, and then set the
Cancel property to true on the CancelEventArgs passed to your event handler.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Aleksey Timonin" <al******@mdgmedical.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi guys,
I show my Form in dialog mode. So I have "Ok" button on it with
DialogResult = Ok. What is the right way and how can I abort form closing
from the button click event.
Thanks a lot
Aleksey