Files
docs-desktop/dotnet-desktop-guide/framework/winforms/controls/how-to-change-the-appearance-of-the-windows-forms-tabcontrol.md
T
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

3.3 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
Change the Appearance of TabControl 03/30/2017
csharp
vb
cpp
icons [Windows Forms], displaying on tabs
TabControl control [Windows Forms], changing page appearance
tabs [Windows Forms], controlling appearance
buttons [Windows Forms], displaying tabs as
7c6cc443-ed62-4d26-b94d-b8913b44f773

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 xref:System.Windows.Forms.TabControl and the xref:System.Windows.Forms.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

  1. Add an xref:System.Windows.Forms.ImageList control to the form.

  2. Add images to the image list.

    For more information about image lists, see ImageList Component and How to: Add or Remove Images with the Windows Forms ImageList Component.

  3. Set the xref:System.Windows.Forms.TabControl.ImageList%2A property of the xref:System.Windows.Forms.TabControl to the xref:System.Windows.Forms.ImageList control.

  4. Set the xref:System.Windows.Forms.TabPage.ImageIndex%2A property of the xref:System.Windows.Forms.TabPage to the index of an appropriate image in the list.

To create multiple rows of tabs

  1. Add the number of tab pages you want.

  2. Set the xref:System.Windows.Forms.TabControl.Multiline%2A property of the xref:System.Windows.Forms.TabControl to true.

  3. If the tabs do not already appear in multiple rows, set the xref:System.Windows.Forms.Control.Width%2A property of the xref:System.Windows.Forms.TabControl to be narrower than all the tabs.

To arrange tabs on the side of the control

To programmatically enable or disable all controls on a tab

  1. Set the xref:System.Windows.Forms.TabPage.Enabled%2A property of the xref:System.Windows.Forms.TabPage to true or false.

    TabPage1.Enabled = False  
    
    tabPage1.Enabled = false;  
    
    tabPage1->Enabled = false;  
    

To display tabs as buttons

See also