2
Answers

SplitterContainer

shailesh

shailesh

14y
2.2k
1

Hi,
I have a MainForm in which i placed the spllittercontainer. On left panel i have one button  btn1 when iclick on this button it shows the form on right panel with the code written in Main form as:
public void ShowForm(Form sender)
{
sender.ControlBox =
false;
sender.FormBorderStyle =
FormBorderStyle.None;
sender.ShowInTaskbar =
false;
sender.TopLevel =
false;
sender.Visible =
true;
sender.Parent =
this;
this.splitContainer2.Panel2.Controls.Clear(); //clear panel first
this.splitContainer2.Panel2.Controls.Add(sender);
}

Now this new form on right Panel  has one button "New". I want to click on this button and place the "New Form" on this right panel  and close the older one.
Can anybody guide me how to do this on the button clcik event  and display the form using the above function from form class.
 
Thanks
AMM

Answers (2)