Closing form

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
 
J

James Hahn

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top