We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

How do I open forms in a tabbed windows form c#.Net

Medium Priority
647 Views
Last Modified: 2013-12-17
I have a main form which i have set it as "isMdiContainer = true" and I am opening other windows forms in it. I want to display the forms that are opened in a tabbed format, i.e. if i have 3 forms opened, i will have 3 tabs, one for each form.

An example of how i need to display the forms is shown in the picture below.

Any help please?

Thanks
untitled.JPG
Comment
Watch Question

High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009
Commented:
Then you don't really need an MDI container form...

...anyhoo, here is an example of opening up Form2 inside tabPage1.  Note the key here is setting the Forms TopLevel() Property to False:
        private void button1_Click(object sender, EventArgs e)
        {
            Form2 f2 = new Form2();
            f2.FormBorderStyle = FormBorderStyle.None;
            f2.Dock = DockStyle.Fill;
            f2.TopLevel = false;
            tabPage1.Controls.Add(f2);
            f2.Show();
        }

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.