I have a main menu and when I click one of the buttons the menu panel should hide and the clicked one should open. This works for one button, but for my second it doesn't. Well, it shows the panel I guess, but it is empty, even though I have something in the panel.
The code is pretty simple, so I don't see where the problem is
public Form1()
{
InitializeComponent();
menu_botStrip.Text = DateTime.Now.ToString("dd/mm/yyyy h:mm tt");
panel_startMenu.Show();
panel_informationService.Hide();
panel_customerManagement.Hide();
}
private void btn_informationService_Click(object sender, EventArgs e)
{
panel_startMenu.Hide();
panel_informationService.Show();
}
private void btn_customerManagement_Click(object sender, EventArgs e)
{
panel_startMenu.Hide();
panel_customerManagement.Show();
}
Make sure that you did not put the second panel inside the first panel. If you dragged the panels from the toolbox, there is high probability of this.
To make sure, open the Document Outline
window (View->Other Windows->Document Outline), and look at the relation between panels. Make sure that they are not contained in one another. They must be at the same level of nesting.
If it is like this:
then select the inner panel and press the left arrow button above the window. Then it should look like:
which is the correct one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With