H
Harry
I have a simple C# windows app with 3 forms(frmMain, frmTest1 and
frmTest2). The frmMain form has a toolbar control docked to top,
groupBox control docked to the left and a panel control dock style
with Fill. frmTest1 have lots of textboxes, buttons, etc. controls on
it. frmTest2 is same as frmTest1 with lots of controls. When I click a
button on the toolbar or groupbox control, I load frmTest1 controls
into the panel control in frmMain. When I click on another toolbar
button, I can clear the panel control and load the other form controls
into panel control. What I would like to do is, changing the panel
from one of the current panel control. Let's say I've loaded the
frmTest1 form into panel. And I would like change the panel after a
button event fired within the panel and change to frmTest form
controls. I can do that from the toolbar buttons, but I cannot do it
within the panel.
Here is how I load the frmTest1 in to panel control in frmMain;
private void button1_Click(object sender, System.EventArgs e)
{
panel.Controls.Clear();
Form frmTest1 = new frmTest1();
frmTest1.TopLevel = false;
panel.Controls.AddRange(new System.Windows.Forms.Control[] {
frmTest1 });
frmTest1.Show();
}
How do I make this call from the frmTest1 buttonTest click event to
load the frmTest2 form controls into panel? Should I make the call
from frmMain or in the frmTest1? I've tried from both but, couldn't
make it work.
Any help will be appriciated.
Thank you in advance.
frmTest2). The frmMain form has a toolbar control docked to top,
groupBox control docked to the left and a panel control dock style
with Fill. frmTest1 have lots of textboxes, buttons, etc. controls on
it. frmTest2 is same as frmTest1 with lots of controls. When I click a
button on the toolbar or groupbox control, I load frmTest1 controls
into the panel control in frmMain. When I click on another toolbar
button, I can clear the panel control and load the other form controls
into panel control. What I would like to do is, changing the panel
from one of the current panel control. Let's say I've loaded the
frmTest1 form into panel. And I would like change the panel after a
button event fired within the panel and change to frmTest form
controls. I can do that from the toolbar buttons, but I cannot do it
within the panel.
Here is how I load the frmTest1 in to panel control in frmMain;
private void button1_Click(object sender, System.EventArgs e)
{
panel.Controls.Clear();
Form frmTest1 = new frmTest1();
frmTest1.TopLevel = false;
panel.Controls.AddRange(new System.Windows.Forms.Control[] {
frmTest1 });
frmTest1.Show();
}
How do I make this call from the frmTest1 buttonTest click event to
load the frmTest2 form controls into panel? Should I make the call
from frmMain or in the frmTest1? I've tried from both but, couldn't
make it work.
Any help will be appriciated.
Thank you in advance.