TabPage Constructor ()

 

Initializes a new instance of the TabPage class.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public TabPage()

The following code example creates a TabControl with one TabPage. The TabPage constructor instantiates tabPage1.

Use the System.Drawing and System.Windows.Forms namespaces for this example.

using System.Windows.Forms;

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

    public void MyTabs()
    {
        this.tabControl1 = new TabControl();

        // Invokes the TabPage() constructor to create the tabPage1.
        this.tabPage1 = new System.Windows.Forms.TabPage();

        this.tabControl1.Controls.Add(tabPage1);
        this.Controls.Add(tabControl1);
    }

    public Form1()
    {
        MyTabs();
    }

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

.NET Framework
Available since 1.1
Return to top
Show: