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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top