R
R.A.F.
Hi,
I would like to have your advice regarding a simple SDI application.
i have 3 forms : FMain, FMainHW and FMainSW.
when my application run FMain display the main menu and interface of the
SDI application.
in this menu i have 2 items HW and SW.
when i click on HW item, it should display FMainHW form into the SDI
application.
when i click on SW item, it should display FMainSW form into this SDI
application.
for that i use the following code :
private void MenuSW_Click(object sender, EventArgs e)
{
TSContainer.ContentPanel.Controls.Clear();
if (this.fmSW != null)
{
fmSW.Parent = TSContainer.ContentPanel;
fmSW.Show();
}
else
{
fmSW = new FMainSW();
fmSW.TopLevel = false;
fmSW.Parent = TSContainer.ContentPanel;
fmSW.Show();
}
}
a similar code is used for HW item.
however, i guess it is not the best method because the memory usage
starts at 19.490 Kb and at each click (switching between the 2 menu
items) it increases a little bit.
so, what is the best way to display in my SDI form other forms without
increasing memory usage.
fmSW and fmHW are private data members of my FMain form class.
thanks a lot,
RAF
I would like to have your advice regarding a simple SDI application.
i have 3 forms : FMain, FMainHW and FMainSW.
when my application run FMain display the main menu and interface of the
SDI application.
in this menu i have 2 items HW and SW.
when i click on HW item, it should display FMainHW form into the SDI
application.
when i click on SW item, it should display FMainSW form into this SDI
application.
for that i use the following code :
private void MenuSW_Click(object sender, EventArgs e)
{
TSContainer.ContentPanel.Controls.Clear();
if (this.fmSW != null)
{
fmSW.Parent = TSContainer.ContentPanel;
fmSW.Show();
}
else
{
fmSW = new FMainSW();
fmSW.TopLevel = false;
fmSW.Parent = TSContainer.ContentPanel;
fmSW.Show();
}
}
a similar code is used for HW item.
however, i guess it is not the best method because the memory usage
starts at 19.490 Kb and at each click (switching between the 2 menu
items) it increases a little bit.
so, what is the best way to display in my SDI form other forms without
increasing memory usage.
fmSW and fmHW are private data members of my FMain form class.
thanks a lot,
RAF