Steve Williams
asked on
How do you hide Main Menu form and show chosen form, then when closing chosen show Main Menu again?
I have coded in Visual Basic for a few years now and can figure most things out. But recently our company has decided to switch to coding in C# due to it being the choice of most of our manufacturing software SDK's which use C# as their preferred coding language.
I'm just starting to code in C# and find that opening and closing forms programmatically are much different than Visual Basic. The Application that I'm writing, displays the Main Menu Form when executing the application. Once the Main Menu is up it has multiple selections. Each selection has its own form. So say the Application is a Fruit Application, on the Main Menu, you have 3 different fruits Apples, Grapes & Kiwi. When I click on the application icon to start the program the main menu form is shown. When I click a selection, Say Grapes, the Grapes Form is opened and the Main Menu is no longer visible. I'm good up to this point. When I close the Grapes form, I want the main menu to reappear after the Grapes form has closed. But it doesn't
Here is my code from the Main Menu:
and here is the code from my Grapes Form
Can someone point me in the right direction? Any help would be greatly appreciated.
I'm just starting to code in C# and find that opening and closing forms programmatically are much different than Visual Basic. The Application that I'm writing, displays the Main Menu Form when executing the application. Once the Main Menu is up it has multiple selections. Each selection has its own form. So say the Application is a Fruit Application, on the Main Menu, you have 3 different fruits Apples, Grapes & Kiwi. When I click on the application icon to start the program the main menu form is shown. When I click a selection, Say Grapes, the Grapes Form is opened and the Main Menu is no longer visible. I'm good up to this point. When I close the Grapes form, I want the main menu to reappear after the Grapes form has closed. But it doesn't
Here is my code from the Main Menu:
private void lblGrapes_Click(object sender, EventArgs e)
{
Visible = false;
frmGrapes ngForm = new frmGrapes();
ngForm.Show();
}
and here is the code from my Grapes Form
private void frmGrapes_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
frmMainMenu mmForm = new frmMainMenu();
mmForm.Show();
}
Can someone point me in the right direction? Any help would be greatly appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER