Home All Groups Group Topic Archive Search About
Author
20 Jun 2006 6:05 PM
phonl
How do I cancel the unloading of a form in VB.NET 2005?

In VB6 I would use "Cancel" in "QueryUnload" event.  Also, is there an
"UnloadMode" parameter in VB.NET?

Author
20 Jun 2006 6:22 PM
Herfried K. Wagner [MVP]
"phonl" <phonl@newsgroups.nospam> schrieb:
> How do I cancel the unloading of a form in VB.NET 2005?
>
> In VB6 I would use "Cancel" in "QueryUnload" event.  Also, is there an
> "UnloadMode" parameter in VB.NET?

Handle the form's 'Closing' event and set 'e.Cancel' to 'True'.  In
addition, check out the form's 'FormClosing' event, specifically its 'e'
parameter.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>