Linking forms

magpies18

Member
Joined
Oct 3, 2008
Messages
12
Programming Experience
Beginner
I have problem linking one form to another like lets say i have two forms. The first form has buttons linking to other forms. So the main menu called mainmenuform has a button which when i click must show the the sales form called sales_staff and hide the main menu form so what is the coding for this and where do i put it?
 
Double click on the button you want to use to open the form, this will take you to the code for the button or create the event in code and place your cursor in it.

Now depending on if you are using MDI parent containers or not here is how you will open the form and bring it to the front...

sales_staff.Show()
sales_staff.BringToFront()

If it is an MDI child form meaning it will be held inside a container then you will need to add the following line to get the form to stay inside the container.

sales_staff.MdiParent = Me.MdiParent
sales_staff.Show()
sales_staff.BringToFront()

To minimize the main menu form you need to add

Me.WindowState = FormWindowState.Minimized
 
Back
Top