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 namespace System::Windows::Forms;
public ref class Form1: public Form
{
private:
   TabControl^ tabControl1;
   TabPage^ tabPage1;

public:
   void MyTabs()
   {
      this->tabControl1 = gcnew TabControl;

      // Invokes the TabPage() constructor to create the tabPage1.
      this->tabPage1 = gcnew System::Windows::Forms::TabPage;
      this->tabControl1->Controls->Add( tabPage1 );
      this->Controls->Add( tabControl1 );
   }

   Form1()
   {
      MyTabs();
   }

};

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

.NET Framework
Available since 1.1
Return to top
Show: