TabControl 클래스
관련된 탭 페이지 집합을 관리합니다.
네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)
구문
‘선언
<ComVisibleAttribute(True)> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
Public Class TabControl
Inherits Control
‘사용 방법
Dim instance As TabControl
[ComVisibleAttribute(true)]
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)]
public class TabControl : Control
[ComVisibleAttribute(true)]
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)]
public ref class TabControl : public Control
/** @attribute ComVisibleAttribute(true) */
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */
public class TabControl extends Control
ComVisibleAttribute(true)
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)
public class TabControl extends Control
설명
TabControl에는 TabPage 개체를 통해 나타나는 탭 페이지가 포함됩니다. 이 개체는 TabPages 속성을 통해 추가할 수 있습니다. 이 컬렉션의 탭 페이지 순서는 컨트롤에 탭이 나타나는 순서를 반영합니다.
컨트롤에서 탭 중 하나를 클릭하여 현재 TabPage를 변경할 수 있습니다. 다음 TabControl 속성 중 하나를 사용하여 현재 TabPage를 프로그래밍 방식으로 변경할 수도 있습니다.
Microsoft .NET Framework version 2.0에서는 다음 메서드 중 하나를 사용할 수도 있습니다.
.NET Framework 2.0에서는 다음 이벤트 중 하나를 처리하여 현재 탭이 변경될 때 응답할 수 있습니다.
TabControl의 탭은 TabControl에 속하지만 개별 TabPage 컨트롤에는 속하지 않습니다. ForeColor 속성과 같은 TabPage 클래스의 멤버는 탭 페이지의 클라이언트 영역에만 영향을 주고 탭에는 영향을 주지 않습니다. 또한 TabPage의 Hide 메서드는 탭을 숨기지 않으므로 탭을 숨기려면 TabControl.TabPages 컬렉션에서 TabPage 컨트롤을 제거해야 합니다.
참고
.NET Framework 2.0에서 탭은 TabPage의 Enter 및 Leave 이벤트가 발생하는 경우를 결정하기 위한 탭 페이지의 일부로 간주됩니다. 이전 버전의 .NET Framework에서 TabPage의 Enter 및 Leave 이벤트는 포커스가 탭으로 이동하거나 탭에서 벗어나는 경우 발생하지 않고 포커스가 탭 페이지의 클라이언트 영역으로 이동하거나 클라이언트 영역에서 벗어나는 경우에만 발생합니다.
참고
TabControl.TabPages 컬렉션에 TabPage가 하나 이상 있어야만 TabControl 클래스에 대해 Control.Click, Control.DoubleClick, Control.MouseDown, Control.MouseUp, Control.MouseHover, Control.MouseEnter, Control.MouseLeave 및 Control.MouseMove 이벤트가 발생합니다. 컬렉션에 TabPage가 하나 이상 있는 경우 사용자가 TabPage 이름이 나타나는 탭 컨트롤의 머리글과 상호 작용하면 TabControl에서 해당 이벤트를 발생시킵니다. 그러나 사용자 상호 작용이 탭 페이지의 ClientRectangle 내에 있는 경우 TabPage는 해당 이벤트를 발생시킵니다.
참고
TabPage에 포함된 컨트롤은 탭 페이지가 표시될 때까지 만들어지지 않으며 이러한 컨트롤의 데이터 바인딩은 탭 페이지가 표시될 때까지 활성화되지 않습니다.
예제
다음 코드 예제에서는 Visual Studio .NET Windows Forms 디자이너를 사용하여 탭 페이지가 세 개 있는 TabControl을 만듭니다. 각 탭 페이지에는 컨트롤이 여러 개 포함됩니다.
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
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());
}
}
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 );
}
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
스레드로부터의 안전성
이 형식의 모든 public static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.
플랫폼
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
2.0, 1.1, 1.0에서 지원
.NET Compact Framework
2.0, 1.0에서 지원