Closing form

  • Thread starter Thread starter CAM
  • Start date Start date
C

CAM

Hello,

I have a form called "Unassigned" that has a control button called "Main
Menu" when pushed the button opens the "main menu" form, but I want to
close the the "Unassigned" form after I press the "Main Menu" button. How
do I code that. Below is my code to open the "main menu" form.

Private Sub btnMainMenu_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnMainMenu.Click
frmMainMenu.Show()
End Sub
 
It depends on exaclty what you mean by 'close', but this will work:

Private Sub btnMainMenu_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnMainMenu.Click
frmMainMenu.Show()
Me.Close()
End Sub

Me.Hide() is another option.
 
Back
Top