Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

C# Windows Form - Open a MDI Child Window in a Tab Control

Posted on 2006-04-03
2
Medium Priority
?
4,255 Views
Last Modified: 2009-07-29
I using C# to create a winform in .NET 2.0 with VS 2005.  I want to open all MDI child forms in their own seperate tab inside the tab control - how do I do this?
0
Comment
Question by:tsmolskow
2 Comments
 
LVL 19

Accepted Solution

by:
Fahad Mukhtar earned 2000 total points
ID: 16370429
           Form2 frm= new Form2();            //child form
            frm.TopLevel = false;
            TabPage tp = new TabPage(frm.Text);
            tabControl1.TabPages.Add(tp);
            frm.Parent  = tp;
            frm.Show();
0
 

Author Comment

by:tsmolskow
ID: 16370787
It works with one change - you have to use ActiveForm.Text - see below

            Form2 frm= new Form2();            //child form
            frm.TopLevel = false;
            TabPage tp = new TabPage(frm.ActiveForm.Text );
            tabControl1.TabPages.Add(tp);
            frm.Parent  = tp;
            frm.Show();
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Make the most of your online learning experience.
Starting up a Project
Screencast - Getting to Know the Pipeline

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question