Versión imprimible       Enviar     
Evaluar y enviar comentarios

  Encender vista de ancho de banda bajo
Esta página es específica de
Microsoft Visual Studio 2005/.NET Framework 2.0

Hay además otras versiones disponibles para:
TabControl (Clase)
Administra un conjunto relacionado de páginas de fichas.

Espacio de nombres: System.Windows.Forms
Ensamblado: System.Windows.Forms (en system.windows.forms.dll)

Visual Basic (Declaración)
<ComVisibleAttribute(True)> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
Public Class TabControl
    Inherits Control
Visual Basic (Uso)
Dim instance As TabControl
C#
[ComVisibleAttribute(true)] 
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
public class TabControl : Control
C++
[ComVisibleAttribute(true)] 
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] 
public ref class TabControl : public Control
J#
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
public class TabControl extends Control
JScript
ComVisibleAttribute(true) 
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) 
public class TabControl extends Control
XAML
No aplicable.

TabControl contiene páginas de fichas, representadas por objetos TabPage, que se agregan mediante la propiedad TabPages. El orden de las páginas de fichas de esta colección refleja el orden en que las fichas aparecen en el control.

El usuario puede cambiar el objeto TabPage actual haciendo clic en una de las fichas del control. También se puede cambiar mediante programación el objeto TabPage actual utilizando una de las propiedades de TabControl siguientes:

En Microsoft .NET Framework versión 2.0, también puede utilizar uno de los métodos siguientes:

En .NET Framework 2.0, puede responder cuando la ficha actual cambie controlando uno de los eventos siguientes:

Las fichas incluidas en TabControl forman parte de TabControl, pero no forman parte de los controles TabPage individuales. Los miembros de la clase TabPage, como la propiedad ForeColor, sólo afectan al rectángulo cliente de la página de fichas, pero no a las fichas. Además, el método Hide de TabPage no ocultará la ficha. Para ocultar la ficha, debe quitar el control TabPage de la colección de TabControl.TabPages.

En .NET Framework 2.0, la ficha se considera parte de la página de fichas para determinar cuándo se producen los eventos Enter y Leave de TabPage. En las versiones anteriores de .NET Framework, los eventos Enter y Leave de TabPage no se producen cuando una ficha tiene el foco o lo pierde, únicamente se producen cuando el rectángulo cliente de la página de fichas tiene el foco o lo pierde.

Los siguientes eventos no se producen para la clase TabControl salvo que haya al menos un objeto TabPage en la colección de TabControl.TabPages: Control.Click, Control.DoubleClick, Control.MouseDown, Control.MouseUp, Control.MouseHover, Control.MouseEnter, Control.MouseLeave y Control.MouseMove. Si en la colección hay un objeto TabPage, como mínimo, y el usuario interactúa con el encabezado del control de ficha (donde aparecen los nombres de TabPage), TabControl provoca el evento apropiado. Sin embargo, si la interacción del usuario se produce dentro de la propiedad ClientRectangle de la página de fichas, TabPage provoca el evento adecuado.

Los controles incluidos en TabPage no se crean hasta que se muestra la página de fichas; tampoco se activan los enlaces de datos de estos controles hasta que dicha página de fichas se muestra.

Cuando los estilos visuales están habilitados y la propiedad Alignment se establece en un valor distinto de Top, es posible que el contenido de las fichas no se represente correctamente. Para evitar este problema, puede dibujar el contenido de las fichas utilizando el dibujo del propietario. Para obtener más información, vea Cómo: Mostrar fichas alineadas a la izquierda con TabControl.

Cuando la propiedad Alignment se establece en un valor distinto de Top y la propiedad Appearance se establece en un valor distinto de Normal, puede que el contenido de la página de fichas no se represente correctamente.

En el ejemplo de código siguiente se utiliza el Diseñador de Windows Forms de Visual Studio .NET para crear un control TabControl con tres páginas de fichas. Cada página de fichas contiene varios controles.

Visual Basic
Public Class Form1
    Inherits System.Windows.Forms.Form
    ' Required designer variable.
    Private components As System.ComponentModel.Container
    
    ' Declares variables.
    Private tab3RadioButton2 As System.Windows.Forms.RadioButton
    Private tab3RadioButton1 As System.Windows.Forms.RadioButton
    Private tab2CheckBox3 As System.Windows.Forms.CheckBox
    Private tab2CheckBox2 As System.Windows.Forms.CheckBox
    Private tab2CheckBox1 As System.Windows.Forms.CheckBox
    Private tab1Label1 As System.Windows.Forms.Label
    Private WithEvents tab1Button1 As System.Windows.Forms.Button
    Private tabPage3 As System.Windows.Forms.TabPage
    Private tabPage2 As System.Windows.Forms.TabPage
    Private tabPage1 As System.Windows.Forms.TabPage
    Private tabControl1 As System.Windows.Forms.TabControl    
    
    Public Sub New()
        ' This call is required for Windows Form Designer support.
        InitializeComponent()
    End Sub    
    
    
    ' This method is required for Designer support.
    Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Me.tabPage1 = New System.Windows.Forms.TabPage()
        Me.tab2CheckBox3 = New System.Windows.Forms.CheckBox()
        Me.tab3RadioButton2 = New System.Windows.Forms.RadioButton()
        Me.tabControl1 = New System.Windows.Forms.TabControl()
        Me.tab2CheckBox2 = New System.Windows.Forms.CheckBox()
        Me.tab2CheckBox1 = New System.Windows.Forms.CheckBox()
        Me.tab3RadioButton1 = New System.Windows.Forms.RadioButton()
        Me.tab1Label1 = New System.Windows.Forms.Label()
        Me.tabPage3 = New System.Windows.Forms.TabPage()
        Me.tabPage2 = New System.Windows.Forms.TabPage()
        Me.tab1Button1 = New System.Windows.Forms.Button()
        
        tabPage1.Text = "tabPage1"
        tabPage1.Size = New System.Drawing.Size(256, 214)
        tabPage1.TabIndex = 0
        tab2CheckBox3.Location = New System.Drawing.Point(32, 136)
        tab2CheckBox3.Text = "checkBox3"
        tab2CheckBox3.Size = New System.Drawing.Size(176, 32)
        tab2CheckBox3.TabIndex = 2
        tab2CheckBox3.Visible = True
        tab3RadioButton2.Location = New System.Drawing.Point(40, 72)
        tab3RadioButton2.Text = "radioButton2"
        tab3RadioButton2.Size = New System.Drawing.Size(152, 24)
        tab3RadioButton2.TabIndex = 1
        tab3RadioButton2.Visible = True
        tabControl1.Location = New System.Drawing.Point(16, 16)
        tabControl1.Size = New System.Drawing.Size(264, 240)
        tabControl1.SelectedIndex = 0
        tabControl1.TabIndex = 0
        tab2CheckBox2.Location = New System.Drawing.Point(32, 80)
        tab2CheckBox2.Text = "checkBox2"
        tab2CheckBox2.Size = New System.Drawing.Size(176, 32)
        tab2CheckBox2.TabIndex = 1
        tab2CheckBox2.Visible = True
        tab2CheckBox1.Location = New System.Drawing.Point(32, 24)
        tab2CheckBox1.Text = "checkBox1"
        tab2CheckBox1.Size = New System.Drawing.Size(176, 32)
        tab2CheckBox1.TabIndex = 0
        tab3RadioButton1.Location = New System.Drawing.Point(40, 32)
        tab3RadioButton1.Text = "radioButton1"
        tab3RadioButton1.Size = New System.Drawing.Size(152, 24)
        tab3RadioButton1.TabIndex = 0
        tab1Label1.Location = New System.Drawing.Point(16, 24)
        tab1Label1.Text = "label1"
        tab1Label1.Size = New System.Drawing.Size(224, 96)
        tab1Label1.TabIndex = 1
        tabPage3.Text = "tabPage3"
        tabPage3.Size = New System.Drawing.Size(256, 214)
        tabPage3.TabIndex = 2
        tabPage2.Text = "tabPage2"
        tabPage2.Size = New System.Drawing.Size(256, 214)
        tabPage2.TabIndex = 1
        tab1Button1.Location = New System.Drawing.Point(88, 144)
        tab1Button1.Size = New System.Drawing.Size(80, 40)
        tab1Button1.TabIndex = 0
        tab1Button1.Text = "button1"
        Me.Text = "Form1"
        
        ' Adds controls to the second tab page.
        tabPage2.Controls.Add(Me.tab2CheckBox3)
        tabPage2.Controls.Add(Me.tab2CheckBox2)
        tabPage2.Controls.Add(Me.tab2CheckBox1)
        ' Adds controls to the third tab page.
        tabPage3.Controls.Add(Me.tab3RadioButton2)
        tabPage3.Controls.Add(Me.tab3RadioButton1)
        ' Adds controls to the first tab page.
        tabPage1.Controls.Add(Me.tab1Label1)
        tabPage1.Controls.Add(Me.tab1Button1)
        ' Adds the TabControl to the form.
        Me.Controls.Add(tabControl1)
        ' Adds the tab pages to the TabControl.
        tabControl1.Controls.Add(Me.tabPage1)
        tabControl1.Controls.Add(Me.tabPage2)
        tabControl1.Controls.Add(Me.tabPage3)
    End Sub   
    
    Private Sub tab1Button1_Click(sender As Object, e As System.EventArgs) _
        Handles tab1Button1.Click
        
        ' Inserts the code that should run when the button is clicked.
    End Sub
    
    Public Shared Sub Main()
        Application.Run(New Form1())
    End Sub
    
End Class

C#
public class Form1 : System.Windows.Forms.Form
{
    // Required designer variable.
    private System.ComponentModel.Container components;

    // Declare variables.
    private System.Windows.Forms.RadioButton tab3RadioButton2;
    private System.Windows.Forms.RadioButton tab3RadioButton1;
    private System.Windows.Forms.CheckBox tab2CheckBox3;
    private System.Windows.Forms.CheckBox tab2CheckBox2;
    private System.Windows.Forms.CheckBox tab2CheckBox1;
    private System.Windows.Forms.Label tab1Label1;
    private System.Windows.Forms.Button tab1Button1;
    private System.Windows.Forms.TabPage tabPage3;
    private System.Windows.Forms.TabPage tabPage2;
    private System.Windows.Forms.TabPage tabPage1;
    private System.Windows.Forms.TabControl tabControl1;
 
    public Form1()
    {
        // This call is required for Windows Form Designer support.
        InitializeComponent();
    }
 
 
    // This method is required for Designer support.
    private void InitializeComponent()
    {
        this.components = new System.ComponentModel.Container();
        this.tabPage1 = new System.Windows.Forms.TabPage();
        this.tab2CheckBox3 = new System.Windows.Forms.CheckBox();
        this.tab3RadioButton2 = new System.Windows.Forms.RadioButton();
        this.tabControl1 = new System.Windows.Forms.TabControl();
        this.tab2CheckBox2 = new System.Windows.Forms.CheckBox();
        this.tab2CheckBox1 = new System.Windows.Forms.CheckBox();
        this.tab3RadioButton1 = new System.Windows.Forms.RadioButton();
        this.tab1Label1 = new System.Windows.Forms.Label();
        this.tabPage3 = new System.Windows.Forms.TabPage();
        this.tabPage2 = new System.Windows.Forms.TabPage();
        this.tab1Button1 = new System.Windows.Forms.Button();

        tabPage1.Text = "tabPage1";
        tabPage1.Size = new System.Drawing.Size(256, 214);
        tabPage1.TabIndex = 0;
        tab2CheckBox3.Location = new System.Drawing.Point(32, 136);
        tab2CheckBox3.Text = "checkBox3";
        tab2CheckBox3.Size = new System.Drawing.Size(176, 32);
        tab2CheckBox3.TabIndex = 2;
        tab2CheckBox3.Visible = true;
        tab3RadioButton2.Location = new System.Drawing.Point(40, 72);
        tab3RadioButton2.Text = "radioButton2";
        tab3RadioButton2.Size = new System.Drawing.Size(152, 24);
        tab3RadioButton2.TabIndex = 1;
        tab3RadioButton2.Visible = true;
        tabControl1.Location = new System.Drawing.Point(16, 16);
        tabControl1.Size = new System.Drawing.Size(264, 240);
        tabControl1.SelectedIndex = 0;
        tabControl1.TabIndex = 0;
        tab2CheckBox2.Location = new System.Drawing.Point(32, 80);
        tab2CheckBox2.Text = "checkBox2";
        tab2CheckBox2.Size = new System.Drawing.Size(176, 32);
        tab2CheckBox2.TabIndex = 1;
        tab2CheckBox2.Visible = true;
        tab2CheckBox1.Location = new System.Drawing.Point(32, 24);
        tab2CheckBox1.Text = "checkBox1";
        tab2CheckBox1.Size = new System.Drawing.Size(176, 32);
        tab2CheckBox1.TabIndex = 0;
        tab3RadioButton1.Location = new System.Drawing.Point(40, 32);
        tab3RadioButton1.Text = "radioButton1";
        tab3RadioButton1.Size = new System.Drawing.Size(152, 24);
        tab3RadioButton1.TabIndex = 0;
        tab1Label1.Location = new System.Drawing.Point(16, 24);
        tab1Label1.Text = "label1";
        tab1Label1.Size = new System.Drawing.Size(224, 96);
        tab1Label1.TabIndex = 1;
        tabPage3.Text = "tabPage3";
        tabPage3.Size = new System.Drawing.Size(256, 214);
        tabPage3.TabIndex = 2;
        tabPage2.Text = "tabPage2";
        tabPage2.Size = new System.Drawing.Size(256, 214);
        tabPage2.TabIndex = 1;
        tab1Button1.Location = new System.Drawing.Point(88, 144);
        tab1Button1.Size = new System.Drawing.Size(80, 40);
        tab1Button1.TabIndex = 0;
        tab1Button1.Text = "button1";
        tab1Button1.Click += new 
           System.EventHandler(this.tab1Button1_Click);
        this.Text = "Form1";

        // Adds controls to the second tab page.
        tabPage2.Controls.Add(this.tab2CheckBox3);
        tabPage2.Controls.Add(this.tab2CheckBox2);
        tabPage2.Controls.Add(this.tab2CheckBox1);
        // Adds controls to the third tab page.
        tabPage3.Controls.Add(this.tab3RadioButton2);
        tabPage3.Controls.Add(this.tab3RadioButton1);
        // Adds controls to the first tab page.
        tabPage1.Controls.Add(this.tab1Label1);
        tabPage1.Controls.Add(this.tab1Button1);
        // Adds the TabControl to the form.
        this.Controls.Add(this.tabControl1);
        // Adds the tab pages to the TabControl.
        tabControl1.Controls.Add(this.tabPage1);
        tabControl1.Controls.Add(this.tabPage2);
        tabControl1.Controls.Add(this.tabPage3);
    }
 
    private void tab1Button1_Click (object sender, System.EventArgs e)
    {
        // Inserts the code that should run when the button is clicked.
    }
 
    public static void Main(string[] args) 
    {
        Application.Run(new Form1());
    }
}
      
C++
public ref class Form1: public System::Windows::Forms::Form
{
private:

   // Required designer variable.
   System::ComponentModel::Container^ components;

   // Declare variables.
   System::Windows::Forms::RadioButton^ tab3RadioButton2;
   System::Windows::Forms::RadioButton^ tab3RadioButton1;
   System::Windows::Forms::CheckBox^ tab2CheckBox3;
   System::Windows::Forms::CheckBox^ tab2CheckBox2;
   System::Windows::Forms::CheckBox^ tab2CheckBox1;
   System::Windows::Forms::Label ^ tab1Label1;
   System::Windows::Forms::Button^ tab1Button1;
   System::Windows::Forms::TabPage^ tabPage3;
   System::Windows::Forms::TabPage^ tabPage2;
   System::Windows::Forms::TabPage^ tabPage1;
   System::Windows::Forms::TabControl^ tabControl1;

public:
   Form1()
   {
      
      // This call is required for Windows Form Designer support.
      InitializeComponent();
   }


private:

   // This method is required for Designer support.
   void InitializeComponent()
   {
      this->components = gcnew System::ComponentModel::Container;
      this->tabPage1 = gcnew System::Windows::Forms::TabPage;
      this->tab2CheckBox3 = gcnew System::Windows::Forms::CheckBox;
      this->tab3RadioButton2 = gcnew System::Windows::Forms::RadioButton;
      this->tabControl1 = gcnew System::Windows::Forms::TabControl;
      this->tab2CheckBox2 = gcnew System::Windows::Forms::CheckBox;
      this->tab2CheckBox1 = gcnew System::Windows::Forms::CheckBox;
      this->tab3RadioButton1 = gcnew System::Windows::Forms::RadioButton;
      this->tab1Label1 = gcnew System::Windows::Forms::Label;
      this->tabPage3 = gcnew System::Windows::Forms::TabPage;
      this->tabPage2 = gcnew System::Windows::Forms::TabPage;
      this->tab1Button1 = gcnew System::Windows::Forms::Button;
      tabPage1->Text = "tabPage1";
      tabPage1->Size = System::Drawing::Size( 256, 214 );
      tabPage1->TabIndex = 0;
      tab2CheckBox3->Location = System::Drawing::Point( 32, 136 );
      tab2CheckBox3->Text = "checkBox3";
      tab2CheckBox3->Size = System::Drawing::Size( 176, 32 );
      tab2CheckBox3->TabIndex = 2;
      tab2CheckBox3->Visible = true;
      tab3RadioButton2->Location = System::Drawing::Point( 40, 72 );
      tab3RadioButton2->Text = "radioButton2";
      tab3RadioButton2->Size = System::Drawing::Size( 152, 24 );
      tab3RadioButton2->TabIndex = 1;
      tab3RadioButton2->Visible = true;
      tabControl1->Location = System::Drawing::Point( 16, 16 );
      tabControl1->Size = System::Drawing::Size( 264, 240 );
      tabControl1->SelectedIndex = 0;
      tabControl1->TabIndex = 0;
      tab2CheckBox2->Location = System::Drawing::Point( 32, 80 );
      tab2CheckBox2->Text = "checkBox2";
      tab2CheckBox2->Size = System::Drawing::Size( 176, 32 );
      tab2CheckBox2->TabIndex = 1;
      tab2CheckBox2->Visible = true;
      tab2CheckBox1->Location = System::Drawing::Point( 32, 24 );
      tab2CheckBox1->Text = "checkBox1";
      tab2CheckBox1->Size = System::Drawing::Size( 176, 32 );
      tab2CheckBox1->TabIndex = 0;
      tab3RadioButton1->Location = System::Drawing::Point( 40, 32 );
      tab3RadioButton1->Text = "radioButton1";
      tab3RadioButton1->Size = System::Drawing::Size( 152, 24 );
      tab3RadioButton1->TabIndex = 0;
      tab1Label1->Location = System::Drawing::Point( 16, 24 );
      tab1Label1->Text = "label1";
      tab1Label1->Size = System::Drawing::Size( 224, 96 );
      tab1Label1->TabIndex = 1;
      tabPage3->Text = "tabPage3";
      tabPage3->Size = System::Drawing::Size( 256, 214 );
      tabPage3->TabIndex = 2;
      tabPage2->Text = "tabPage2";
      tabPage2->Size = System::Drawing::Size( 256, 214 );
      tabPage2->TabIndex = 1;
      tab1Button1->Location = System::Drawing::Point( 88, 144 );
      tab1Button1->Size = System::Drawing::Size( 80, 40 );
      tab1Button1->TabIndex = 0;
      tab1Button1->Text = "button1";
      tab1Button1->Click += gcnew System::EventHandler( this, &Form1::tab1Button1_Click );
      this->Text = "Form1";
      
      // Adds controls to the second tab page.
      tabPage2->Controls->Add( this->tab2CheckBox3 );
      tabPage2->Controls->Add( this->tab2CheckBox2 );
      tabPage2->Controls->Add( this->tab2CheckBox1 );
      
      // Adds controls to the third tab page.
      tabPage3->Controls->Add( this->tab3RadioButton2 );
      tabPage3->Controls->Add( this->tab3RadioButton1 );
      
      // Adds controls to the first tab page.
      tabPage1->Controls->Add( this->tab1Label1 );
      tabPage1->Controls->Add( this->tab1Button1 );
      
      // Adds the TabControl to the form.
      this->Controls->Add( this->tabControl1 );
      
      // Adds the tab pages to the TabControl.
      tabControl1->Controls->Add( this->tabPage1 );
      tabControl1->Controls->Add( this->tabPage2 );
      tabControl1->Controls->Add( this->tabPage3 );
   }

   void tab1Button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      
      // Inserts the code that should run when the button is clicked.
   }

};

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

J#
public class Form1 extends System.Windows.Forms.Form
{
    // Required designer variable.
    private System.ComponentModel.Container components;

    // Declare variables.
    private System.Windows.Forms.RadioButton tab3RadioButton2;
    private System.Windows.Forms.RadioButton tab3RadioButton1;
    private System.Windows.Forms.CheckBox tab2CheckBox3;
    private System.Windows.Forms.CheckBox tab2CheckBox2;
    private System.Windows.Forms.CheckBox tab2CheckBox1;
    private System.Windows.Forms.Label tab1Label1;
    private System.Windows.Forms.Button tab1Button1;
    private System.Windows.Forms.TabPage tabPage3;
    private System.Windows.Forms.TabPage tabPage2;
    private System.Windows.Forms.TabPage tabPage1;
    private System.Windows.Forms.TabControl tabControl1;

    public Form1()
    {
        // This call is required for Windows Form Designer support.
        InitializeComponent();
    } //Form1

    // This method is required for Designer support.
    private void InitializeComponent()
    {
        this.components = new System.ComponentModel.Container();
        this.tabPage1 = new System.Windows.Forms.TabPage();
        this.tab2CheckBox3 = new System.Windows.Forms.CheckBox();
        this.tab3RadioButton2 = new System.Windows.Forms.RadioButton();
        this.tabControl1 = new System.Windows.Forms.TabControl();
        this.tab2CheckBox2 = new System.Windows.Forms.CheckBox();
        this.tab2CheckBox1 = new System.Windows.Forms.CheckBox();
        this.tab3RadioButton1 = new System.Windows.Forms.RadioButton();
        this.tab1Label1 = new System.Windows.Forms.Label();
        this.tabPage3 = new System.Windows.Forms.TabPage();
        this.tabPage2 = new System.Windows.Forms.TabPage();
        this.tab1Button1 = new System.Windows.Forms.Button();
        tabPage1.set_Text("tabPage1");
        tabPage1.set_Size(new System.Drawing.Size(256, 214));
        tabPage1.set_TabIndex(0);
        tab2CheckBox3.set_Location(new System.Drawing.Point(32, 136));
        tab2CheckBox3.set_Text("checkBox3");
        tab2CheckBox3.set_Size(new System.Drawing.Size(176, 32));
        tab2CheckBox3.set_TabIndex(2);
        tab2CheckBox3.set_Visible(true);
        tab3RadioButton2.set_Location(new System.Drawing.Point(40, 72));
        tab3RadioButton2.set_Text("radioButton2");
        tab3RadioButton2.set_Size(new System.Drawing.Size(152, 24));
        tab3RadioButton2.set_TabIndex(1);
        tab3RadioButton2.set_Visible(true);
        tabControl1.set_Location(new System.Drawing.Point(16, 16));
        tabControl1.set_Size(new System.Drawing.Size(264, 240));
        tabControl1.set_SelectedIndex(0);
        tabControl1.set_TabIndex(0);
        tab2CheckBox2.set_Location(new System.Drawing.Point(32, 80));
        tab2CheckBox2.set_Text("checkBox2");
        tab2CheckBox2.set_Size(new System.Drawing.Size(176, 32));
        tab2CheckBox2.set_TabIndex(1);
        tab2CheckBox2.set_Visible(true);
        tab2CheckBox1.set_Location(new System.Drawing.Point(32, 24));
        tab2CheckBox1.set_Text("checkBox1");
        tab2CheckBox1.set_Size(new System.Drawing.Size(176, 32));
        tab2CheckBox1.set_TabIndex(0);
        tab3RadioButton1.set_Location(new System.Drawing.Point(40, 32));
        tab3RadioButton1.set_Text("radioButton1");
        tab3RadioButton1.set_Size(new System.Drawing.Size(152, 24));
        tab3RadioButton1.set_TabIndex(0);
        tab1Label1.set_Location(new System.Drawing.Point(16, 24));
        tab1Label1.set_Text("label1");
        tab1Label1.set_Size(new System.Drawing.Size(224, 96));
        tab1Label1.set_TabIndex(1);
        tabPage3.set_Text("tabPage3");
        tabPage3.set_Size(new System.Drawing.Size(256, 214));
        tabPage3.set_TabIndex(2);
        tabPage2.set_Text("tabPage2");
        tabPage2.set_Size(new System.Drawing.Size(256, 214));
        tabPage2.set_TabIndex(1);
        tab1Button1.set_Location(new System.Drawing.Point(88, 144));
        tab1Button1.set_Size(new System.Drawing.Size(80, 40));
        tab1Button1.set_TabIndex(0);
        tab1Button1.set_Text("button1");
        tab1Button1.add_Click(new System.EventHandler(this.tab1Button1_Click));
        this.set_Text("Form1");

        // Adds controls to the second tab page.
        tabPage2.get_Controls().Add(this.tab2CheckBox3);
        tabPage2.get_Controls().Add(this.tab2CheckBox2);
        tabPage2.get_Controls().Add(this.tab2CheckBox1);

        // Adds controls to the third tab page.
        tabPage3.get_Controls().Add(this.tab3RadioButton2);
        tabPage3.get_Controls().Add(this.tab3RadioButton1);

        // Adds controls to the first tab page.
        tabPage1.get_Controls().Add(this.tab1Label1);
        tabPage1.get_Controls().Add(this.tab1Button1);

        // Adds the TabControl to the form.
        this.get_Controls().Add(this.tabControl1);

        // Adds the tab pages to the TabControl.
        tabControl1.get_Controls().Add(this.tabPage1);
        tabControl1.get_Controls().Add(this.tabPage2);
        tabControl1.get_Controls().Add(this.tabPage3);
    } //InitializeComponent

    private void tab1Button1_Click(Object sender, System.EventArgs e)
    {
        // Inserts the code that should run when the button is clicked.
    } //tab1Button1_Click
    
    public static void main(String[] args)
    {
        Application.Run(new Form1());
    } //main
} //Form1
System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.Windows.Forms.Control
        System.Windows.Forms.TabControl
Los miembros estáticos públicos (Shared en Visual Basic) de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Windows 98, Windows 2000 Service Pack 4, Windows CE, Windows Millennium, Windows Mobile para Pocket PC, Windows Server 2003, Windows XP Media Center, Windows XP Professional x64, Windows XP SP2, Windows XP Starter

Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.

.NET Framework

Compatible con: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Compatible con: 2.0, 1.0
© 2009 Microsoft Corporation. Reservados todos los derechos. Términos de uso  |  Marcas Registradas  |  Privacidad
Page view tracker