TabControl.Appearance Property

Definition

Gets or sets the visual appearance of the control's tabs.

C#
public System.Windows.Forms.TabAppearance Appearance { get; set; }

Property Value

One of the TabAppearance values. The default is Normal.

Exceptions

The property value is not a valid TabAppearance value.

Examples

The following code example creates a TabControl with two TabPage objects. This example sets the Appearance property to Buttons, which displays the tabs of the tab pages as buttons.

C#
using System.Windows.Forms;

public class Form1 : Form
{
    public Form1()
    {
        string[] tabText = {"tabPage1", "tabPage2"};
        TabControl tabControl1 = new TabControl();
        TabPage tabPage1 = new TabPage(tabText[0]);
        TabPage tabPage2 = new TabPage(tabText[1]);

        // Sets the tabs to appear as buttons.
        tabControl1.Appearance = TabAppearance.Buttons;

        tabControl1.Controls.AddRange(new TabPage[] {tabPage1, tabPage2});
        Controls.Add(tabControl1);
    }

    static void Main()
    {
        Application.Run(new Form1());
    }
}

Remarks

When you set the Appearance property to FlatButtons, it only appears as such when the Alignment property is set to Top. Otherwise, the Appearance property appears as if set to the Buttons value.

Note

When you set the Appearance property to Buttons, you must also set the Alignment property to Top so that the tab page contents display correctly.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also