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
Loading
shaileshPosted Mar 12, 2010, 5:53 PM
I subscribed to the one custom event when New botton is pressed on right panel form , it is going to the event handler in MainForm but it is not showing next form. Can you please point out the issue in this? I have source code here for VS 2005.
1. Run the project.
2. Click on Citation button on left pane and it will display the frmhistory form.
3. Now clcik on "new" button on this frmhistory form and it should display the "FrmCutation form in right pane but it is not displaying.
Thanks
shailesh
Sam HobbsPosted Mar 11, 2010, 9:42 PM