Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change the name of the tabcontrol

I am using a Tab Control in a C# WinForms application. I want to change the title of the tabs. By default they are tabPage1, tabPage2, etc.

enter image description here

like image 1000
Surya sasidhar Avatar asked Oct 24 '09 07:10

Surya sasidhar


3 Answers

A lazy way to do it without code:

  • Select the tab control

Select the tab control

  • Go to properties, use F4 to do so
  • Select TabPages property, use F4 to do so
  • Click the ... after the (Collection).

tab control properties

  • Edit the name and any tabPage properties associated with it.

Edit the name and any <code>tabPage</code> properties

like image 192
Benkax Avatar answered Nov 08 '22 06:11

Benkax


You can change it pretty simply in the designer; click on a blank area in the tab page contents and use the property view to set the Text property. Also through code via:

tabPage1.Text = @"Something Meaningful";

Where tabPage1 would be the reference to whichever TabPage you wanted to set the Text of.

like image 35
Quintin Robinson Avatar answered Nov 08 '22 05:11

Quintin Robinson


tabCtrl.TabPages[0].Text = "some text";
tabCtrl.TabPages[1].Text = "some other text";
like image 16
Andrew Keith Avatar answered Nov 08 '22 04:11

Andrew Keith