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)

public:
property TabAppearance Appearance {
	TabAppearance get ();
	void set (TabAppearance value);
}

Property Value

Type: System.Windows.Forms::TabAppearance
One of the TabAppearance values. The default is Normal.

ExceptionCondition
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 tab page contents 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 namespace System;
using namespace System::Windows::Forms;
public ref class Form1: public Form
{
public:
   Form1()
   {
      array<String^>^tabText = {"tabPage1","tabPage2"};
      TabControl^ tabControl1 = gcnew TabControl;
      TabPage^ tabPage1 = gcnew TabPage( tabText[ 0 ] );
      TabPage^ tabPage2 = gcnew TabPage( tabText[ 1 ] );

      // Sets the tabs to appear as buttons.
      tabControl1->Appearance = TabAppearance::Buttons;
      array<TabPage^>^tabPageArray = {tabPage1,tabPage2};
      tabControl1->Controls->AddRange( tabPageArray );
      Controls->Add( tabControl1 );
   }

};

int main()
{
   Application::Run( gcnew Form1 );
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft