How to use panels

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok. I am new to desktop apps. I have a form with tool strip at the top and a
split container below it. I have panels in the split container. When I click
on a button in the toolbar, it opens up a user control in the left panel
which consists of buttons. These buttons need to open user control forms in
the right pannel. I can seem to figure out how to open the user control in
the right panel when I click on the buttons in the left panel????
 
Hi Dave,

In the click event of the button try something like

UserControl1 uc = new UserControl1();
splitContainer.Panel2.Controls.Clear();
splitContainer.Panel2.Controls.Add(uc);

Now, you may instead want to create all necessary user controls once at startup and add all of them to splitContainer.Panel2. Then bring the specific UserControl to the front by having it call BringToFront().
 
Back
Top