How to: Change the Appearance of the Windows Forms TabControl
You can change the appearance of tabs in Windows Forms by using properties of the TabControl and the TabPage objects that make up the individual tabs on the control. By setting these properties, you can display images on tabs, display tabs vertically instead of horizontally, display multiple rows of tabs, and enable or disable tabs programmatically.
To display an icon on the label part of a tab
Add an ImageList control to the form.
Add images to the image list.
For more information about image lists, see ImageList Component (Windows Forms) and How to: Add or Remove Images with the Windows Forms ImageList Component.
Set the ImageList property of the TabControl to the ImageList control.
Set the ImageIndex property of the TabPage to the index of an appropriate image in the list.
To create multiple rows of tabs
Add the number of tab pages you want.
Set the Multiline property of the TabControl to true.
If the tabs do not already appear in multiple rows, set the Width property of the TabControl to be narrower than all the tabs.
To arrange tabs on the side of the control
- Set the Alignment property of the TabControl to Left or Right.
To programmatically enable or disable all controls on a tab
Set the Enabled property of the TabPage to true or false.
TabPage1.Enabled = False
tabPage1.Enabled = false;
tabPage1->Enabled = false;
To display tabs as buttons
- Set the Appearance property of the TabControl to Buttons or FlatButtons.
See Also
Tasks
How to: Add a Control to a Tab Page
How to: Add and Remove Tabs with the Windows Forms TabControl
Reference
TabControl Control Overview (Windows Forms)
Other Resources
TabControl Control (Windows Forms)
Change History
Date |
History |
Reason |
---|---|---|
July 2010 |
Clarified the function of the Enabled property. |
Customer feedback. |