Both answer from Kumar and Mike is true.

You can't put a Form in the Panel.
But you need to implement MDI features. You need to study on that.

At first (MainForm Load) you need to load all your MDIChilds.

FormName1 ChildForm1=new FormName1();
ChildForm1.MdiParent = Me;
FormName2 ChildForm2=new FormName2();
ChildForm2.MdiParent = Me;

But don't show it first.

Then when user click on the menu item to show ChildForm1, you can show
it by:

if ( ! Me.ActiveMdiChild == null)
{
   Me.ActiveMdiChild.Visible = false;
}
ChildForm1.Visible = true;

Note that you close the active Mdi first before the ChildForm1 become
active.



Another method is you totally not using Form for the child. Just use
UserControl.
Create UserControl1 and UserControl2 then when user click menu item,
just add the UserControl to the Panel.Controls in the MainForm.

This option is useful if you are not familiar with MDI.


On Mar 4, 4:34 am, "[email protected]"
<[email protected]> wrote:
> Hi
>
> Before I ask something , I would like to introduce myself. My Name is
> Raman Kumar and I am from Gurgoan.
> I am a  bit new C#.Net ( framework 3.5),  I Required your Help because
> i got stuck today.
>
> I have one Winform called "Main Form" where in i have created my Menu
> bar on the Top.
> Now i have 12-15 another sub form which I want to display just below
> the Menu bar , User will click in options of menu bar and
> corresponding win form should appear on the same "Main Form" and
> Existing sub form Should get closed.
>
> In order  to do the same , I thought of making Panel on " Main Form "
> just below the Menu bar and want to replace the panel design value
> with other win form on user click event.
>
> Now Question 1. - Is it Possible to do so ..... ??
>                      2.  If Yes then what code i need to write on
> click event so that it can replace panel value with corresponding win
> form.
>                      3.  If no than what is the another way to get
> this done.

Reply via email to