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

Posted on 2006-04-03
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?
Question by:tsmolskow
    LVL 19

    Accepted Solution

               Form2 frm= new Form2();            //child form
                frm.TopLevel = false;
                TabPage tp = new TabPage(frm.Text);
                frm.Parent  = tp;

    Author Comment

    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 );
                frm.Parent  = tp;

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    A short article about problems I had with the new location API and permissions in Marshmallow
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now