Jieha Lee

Jieha Lee

  • 1.5k
  • 186
  • 9k

How to Display Different Panel using same button

Jul 17 2018 10:51 PM
In first panel has 4 button (Customer, Advisor, DPI and Cashier) which is all button direct to same panel. In Screen2 has 2 button(Customer Service, Ambassador) and direct to 3 different panel. The pathway is like this:
 
1) Customer(1st panel) - Customer Service(2nd panel) - main form(3rd panel)
2) Advisor(1st panel) - Customer Service(2nd panel) - sub form(4th panel) 
3) DPI(1st panel) - Ambassador(2nd panel) - form1(5th panel)
4) Cashier(1st panel) - Ambassador(2nd panel) - form1(5th panel) 
 
For the (3) and (4) i already solved it but I cannnot find the solution for (1) and (2).
Here my code for Customer Service button to display 3rd and 4th panel but still the panel not display. Is the code wrong?
 
private void btnCustService_Click(object sender, EventArgs e)
{
Button btn = sender as Button;
switch (btn.Text)
{
case "Customer":
panelMainForm.BringToFront();
break;
case "Advisor":
panelSubForm.BringToFront();
break;
}
}
 
Thanks 

Answers (3)