Module help

webyugioh

Member
Joined
Feb 21, 2006
Messages
6
Programming Experience
Beginner
I need help on how to switch between forms. i only know one way.
here is a example of what i know

sub test
dim test1 as new form1
dim test2 as new form2
form2.showdialog
form1.close

the only problem with this is when i use it it opens form2 but does not close form1. if i am doing something wrong or there is a better way please tell me a help me out.

btw i am useing VB.NET ver 7

thanks
 
About the ShowDialog method, when this method is called, the code following it is not executed until after the dialog box is closed.
 
You could .Hide the form showing, .Show the next form, the .Close the first.
There is a setting in VS2005 for when the application shuts down, (1) when main form is closed, or (2) when last form is closed. Last option is beneficial when you are closing mainform and want to keep application running with another form.
 
VB.NET:
Me.Hide
dim f2 as new form2
f2.Show
Me.Close
 
Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
Back
Top