954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to make a child form fix into a main form which panel alocated.

I am using C# 2005. How to show a child form fix into a main form which panel alocated when I click a button in main form. Thanks!
:'(

csy
Light Poster
26 posts since Oct 2007
Reputation Points: 10
Solved Threads: 1
 

If you are referring to placing another form into a Panel on the Main form, this should really be done using a UserControl. However,

Form2 fm2 = new Form2();
            fm2.TopLevel = false;
            fm2.Dock = DockStyle.Fill;
            panel1.Controls.Add(fm2);
            fm2.Show();


You can put a form into another control (such as a panel) on a TopLevel form like your main form by using the code above. You should typically set the second form's control box off, and set the Text of the second form to empty, also set the border to none.. But that is just you choice.

//Jerry

JerryShaw
Posting Pro in Training
465 posts since Nov 2006
Reputation Points: 69
Solved Threads: 75
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You