closing and re-open forms problems

  • Thread starter Thread starter =?iso-8859-1?Q?Kjartan_Malthe-S=F8renssen?=
  • Start date Start date
?

=?iso-8859-1?Q?Kjartan_Malthe-S=F8renssen?=

Hi

I'm developing in VB.NET and was wondering how to open a
form that has been closed by a user by pressing the close
button (X) on the form. I currently use a Back and Next
button to navigate through a simple wizard that i
created, but pressing the forms close button will
generate an exception when trying to re-display the from
that was closed.

Also is there a way to override the close button on a
form so that when a user presses this button it is not
closed but hidden instead?

Thank you!

kjartan
 
Hi,

The simpliest way to achieve that is to set ControlBox to False, but the
icon is not displayed.

The Second way is:
1. Declare a boolean CanClose
2. In your close/cancel button, type
CanClose = True
Me.Close
3. In the From_Closing, use the parameter e to cancel the action with
e.Cancel = Not CanClose

Serge
 
Back
Top