TabControl Constructor

Definición

Inicializa una nueva instancia de la clase TabControl.

C#
public TabControl ();

Ejemplos

En el ejemplo de código siguiente se crea un objeto TabControl con uno TabPage. El TabControl constructor crea una instancia de tabControl1.

C#
using System.Windows.Forms;

public class Form1 : Form
{
    private TabControl tabControl1;
    private TabPage tabPage1;

    public void MyTabs()
    {
        // Invokes the TabControl() constructor to create the tabControl1 object.
        this.tabControl1 = new System.Windows.Forms.TabControl();

        // Creates a new tab page and adds it to the tab control
        this.tabPage1 = new TabPage();
                
        this.tabControl1.TabPages.Add(tabPage1);

        // Adds the tab control to the form
        this.Controls.Add(tabControl1);
    }

    public Form1()
    {
        MyTabs();
    }

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

Se aplica a

Producto Versiones
.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
Windows Desktop 3.0, 3.1, 5, 6, 7