TabControl.Appearance Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém ou definem a aparência visual das abas do controlo.
public:
property System::Windows::Forms::TabAppearance Appearance { System::Windows::Forms::TabAppearance get(); void set(System::Windows::Forms::TabAppearance value); };
public System.Windows.Forms.TabAppearance Appearance { get; set; }
member this.Appearance : System.Windows.Forms.TabAppearance with get, set
Public Property Appearance As TabAppearance
Valor de Propriedade
Um dos TabAppearance valores. A predefinição é Normal.
Exceções
O valor da propriedade não é válido TabAppearance .
Exemplos
O seguinte exemplo de código cria um TabControl com dois TabPage objetos. Este exemplo define a Appearance propriedade como Buttons, que mostra os separadores das páginas de separadores como botões.
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 );
}
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());
}
}
Imports System.Windows.Forms
Public Class Form1
Inherits Form
Public Sub New()
Dim tabText As String() = {"tabPage1", "tabPage2"}
Dim tabControl1 As New TabControl()
Dim tabPage1 As New TabPage(tabText(0))
Dim tabPage2 As 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)
End Sub
Shared Sub Main()
Application.Run(New Form1())
End Sub
End Class
Observações
Quando defines a Appearance propriedade para FlatButtons, ela só aparece assim quando a Alignment propriedade está definida para Top. Caso contrário, a Appearance propriedade parece estar definida ao Buttons valor.
Note
Quando definir a Appearance propriedade para Buttons, também deve definir a Alignment propriedade para Top que o conteúdo da página do separador seja exibido corretamente.