0

Hi Guys!

I wanna ask questions about the code

Me.hide

I have a button to switch between two forms, and I used the me.hide code to perform the action.
However When I exit the program, the debug is still on, meaning that the form which I hide is still running.
But if I use the code

Me.close

the whole program closes down.
Is there a way to close down a form and a new form is shown up, and be able to switch back the first form and stop the debugging process after exiting?

Thank you!

3
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by codeorder
0

Just adding my 2 cents worth.

In the File Menu, Project/Properties, Application Tab, you can locate the Shutdown Mode: Options which allow you to Shutdown the application "When startup form closes" or "When last form closes".

Selecting when last form closes, always show the other form first, then close the current one. example:

Form2.Show()
        Me.Close()

Closing a Form, the current data set on the Form will be reset to the original data of the Form. For example, having a Textbox on Form1 and using the above code, if you had text typed into the Textbox, the text will be lost.

In the case that you want to keep the data as is on a Form, use the .Hide() option.

Edited by codeorder: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.