Export (0) Print
Expand All

TabControl.Appearance Property

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

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

[LocalizableAttribute(true)] 
public TabAppearance Appearance { get; set; }
/** @property */
public TabAppearance get_Appearance ()

/** @property */
public void set_Appearance (TabAppearance value)

public function get Appearance () : TabAppearance

public function set Appearance (value : TabAppearance)

Property Value

One of the TabAppearance values. The default is Normal.

Exception typeCondition

InvalidEnumArgumentException

The property value is not a valid TabAppearance value.

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.

NoteNote

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

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.

Use the System.Windows.Forms namespace for this example.

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());
    }
}

import System.Windows.Forms.*;

public class Form1 extends 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.set_Appearance(TabAppearance.Buttons);
        tabControl1.get_Controls().AddRange(new TabPage[] {tabPage1, tabPage2});
        get_Controls().Add(tabControl1);
    } //Form1

    public static void main(String[] args)
    {
        Application.Run(new Form1());
    } //main
} //Form1

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft