Reading Time: 1 minute

C sharp tab control is control from TabControl Class. C sharp tab control is the part of C# Containers Toolbox.


Once when it is added to Windows form, additional tabs can be added as collection.


We can add two more command buttons to form, one for adding tabs on click, and another for removing tabs on click.

Corresponding code is:
int int_how_many_tabs = 2;
private void btnAdd_Click(object sender, EventArgs e)

string str_title = “New Tab” + (++int_how_many_tabs).ToString();
TabPage myTabPage = new TabPage(str_title);


private void btnRemove_Click(object sender, EventArgs e)




MessageBox.Show(“No more tabs”,”Tabs”,MessageBoxButtons.OK,MessageBoxIcon.Stop);


All tabs can be counted and their number can be converted to string by
string str_title = “New Tab” + tabControl1.TabCount.ToString();

note: Access to TabControl TabPages is similar to access of ListBox Items (SelectedTab <=> SelectedIndex).

External links:

C Sharp Tab Control on C-Sharpcorner
C Sharp Tab Control on Microsoft
C Sharp Tab Control on Yevol

Leave a Reply

Your email address will not be published. Required fields are marked *