Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6889237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:07:50+00:00 2026-05-27T06:07:50+00:00

I have a TabControl in a windows form. I have pragmaticly added new tabs

  • 0

I have a TabControl in a windows form. I have pragmaticly added new tabs like so:

for (int i = 1; i < numOfLanguages; i++)
{
     // add a tab for each language
     string tabTitle = split[i];
     TabPage newTab = new TabPage(tabTitle);
     languageTabs.TabPages.Add(newTab);
}

inside the loop I want to set up the other controlls for each tab. mainly I want to add buttons. I have seen this code:

tabPage1.Controls.Add(new Button());

Based off this example I want to do something similar like:

languageTabs.SelectTab(split[i]).Add(new Button());

I know that this code wont work. Have been looking through the params and cant see anything that lets me do this kind of thing.

Any ideas community?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:07:51+00:00Added an answer on May 27, 2026 at 6:07 am

    SelectTab moves the actual TabControl to the specified tab, it does not return the tab to let you manipulate it.


    You can index into the tab pages as follows:

    languageTabs.TabPages[2].Controls.Add(new Button());
    

    If you have set the Name property on the TabPage on creation, then you can also find individual tabs by key:

    for (int i = 1; i < numOfLanguages; i++)
    {
         // add a tab for each language
         string tabTitle = split[i];
         TabPage newTab = new TabPage(tabTitle);
         newTab.Name = tabTitle;
         languageTabs.TabPages.Add(newTab);
    }
    
    ...
    
    languageTabs.TabPages[split[i]].Controls.Add(new Button());
    

    (See MSDN for more)

    Whichever is most convenient.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a windows form with a primary tab control and multiple tabs (tabTest1,
In Windows Forms the default behaviour of a TabControl is to have the tabs
I have three Tabs in my Windows Forms form. Depending on the selected RadioButton
I have a tab control in my Windows Form, and I want to iterate
I have idea to implement my wpf windows like TabPages in tab control. It
I have three tabs in a Windows Forms tab control. Currently in Tab1 I
How can i remove the tabs from tabcontrol when i reference each tab to
I would like to have the tabs on my TabControl displayed on the left,
I have created a Windows form using a Tab Control, but it has a
I have TabControl. I added it to tabpages. To one of them(tpTags) I dynamically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.