How to open the child form inside the parent form in windows form

Experts
My question is that when I click a menu item then a new window opens by virtue of the following code

Form2  f2=new Form2();
f2.show();

Actually this opens the new and separate form.
I want the form should be inside the parent form .That is the new form should not open separately rather it should appear that the new form is embedded in the main parent form. Please see the image attached .

I  do not know the exactly technical term to describe what I want .

so please see the image to understand my query.
Provide me some tutorials or urls or code to implement the actions of the image.
Thanking you


query.JPG
ANINDYAAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TribmosCommented:
With what you describe there what you want is instead of a "Form" have it be a custom control.

What happens is on that "panel" you create and add this custom control during runtime.

Basically its treated very similar to a form (design) but its treated like a control (button, text box, etc etc) but lacks the title bar and other independent features that a form has.
0
TribmosCommented:
Found a fairly good guide to get a handle on how to do this

http://www.akadia.com/services/dotnet_user_controls.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mike TomlinsonMiddle School Assistant TeacherCommented:
Good answer by Tribmos.

You can technically use Forms in this manner if you make them borderless and set their TopMost() Property to False.  This allows you to add them to containers just like any other control.

For instance, if you wanted to add your instance of Form2 to a Panel1 you could do:

    Form2 f2 = new Form2();
    f2.TopMost = false;  // won't work without this
    this.Panel1.Controls.Add(f2);
    f2.show();

You can make the form fill the entire panel by setting its Dock() Property to Fill.
0
ANINDYAAuthor Commented:
Experts if possible please provide me some more urls on the custom control.
Thanks for the suggestions
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.