/  3
 
 SEB’s VB.NET Guide
Loading & RemovingForms
Using Multiple Forms
 Multiple Forms
– you can use more than one form and switch between them. This hasthe effect of providing the user with multiple screens.To identify the start-up form:
Right-click on the project in your 
 Project Explorer window
Select Properties
Use the startup object drop-down box to select your start-up formTo maximise your form:
Me.WindowState = FormWindowState.Maximized
Create a new form
Select Properties
Select Add Windows Form
Select Windows Form (this is the default)
Type in a name (leave the .VB)
Select Open
Loading a new form
In the original form select the event that you want to load the new form
Create a variable of type ‘the new form’
Assuming you have created a new form called fNewForm you would type:
Dim frmNewForm as fNewForm 
Create an instance of the new form
frmNewForm = New fNewForm()
 Page 1 of 3
 
 SEB’s VB.NET Guide
Show the new form
frmNewForm.Show()
If you do not want your user to be able to continue using the original form while the newform is open, use
ShowDialog 
rather than
Show
. This forces the user to close the form inorder to go back.
frmNewForm.ShowDialog()
 Page 2 of 3

Share & Embed

More from this user

Add a Comment

Characters: ...