次の方法で共有


TabControl.TabPageCollection.Add メソッド

定義

タブ ページをコレクションに追加します。

オーバーロード

名前 説明
Add(String)

指定したテキストを含むタブ ページを作成し、コレクションに追加します。

Add(TabPage)

コレクションに TabPage を追加します。

Add(String, String)

指定したテキストとキーを持つタブ ページを作成し、コレクションに追加します。

Add(String, String, Int32)

指定したキー、テキスト、およびイメージを持つタブ ページを作成し、コレクションに追加します。

Add(String, String, String)

指定したキー、テキスト、およびイメージを持つタブ ページを作成し、コレクションに追加します。

Add(String)

ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs

指定したテキストを含むタブ ページを作成し、コレクションに追加します。

public:
 void Add(System::String ^ text);
public void Add(string text);
public void Add(string? text);
member this.Add : string -> unit
Public Sub Add (text As String)

パラメーター

text
String

タブ ページに表示するテキスト。

注釈

新しく作成された TabPage がコレクションの末尾に追加されます。

適用対象

Add(TabPage)

ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs

コレクションに TabPage を追加します。

public:
 void Add(System::Windows::Forms::TabPage ^ value);
public void Add(System.Windows.Forms.TabPage value);
member this.Add : System.Windows.Forms.TabPage -> unit
Public Sub Add (value As TabPage)

パラメーター

value
TabPage

追加する TabPage

例外

指定した valuenull

次のコード例では、1 つのTabPageTabControlを作成します。 この例では、 Add メソッドを使用して、 tabControl1 タブ コントロールに 1 つのタブ ページを追加します。 TabPages プロパティを使用して、tabControl1 コントロール コレクションを取得し、このコレクションにtabPage1を追加します。

using namespace System::Drawing;
using namespace System::Windows::Forms;
public ref class Form1: public Form
{
private:
   TabControl^ tabControl1;
   TabPage^ tabPage1;

public:
   Form1()
   {
      this->tabControl1 = gcnew TabControl;
      this->tabPage1 = gcnew TabPage;
      
      // Gets the controls collection for tabControl1.
      // Adds the tabPage1 to this collection.
      this->tabControl1->TabPages->Add( tabPage1 );
      this->tabControl1->Location = Point(25,25);
      this->tabControl1->Size = System::Drawing::Size( 250, 250 );
      this->ClientSize = System::Drawing::Size( 300, 300 );
      this->Controls->Add( tabControl1 );
   }

};

int main()
{
   Application::Run( gcnew Form1 );
}
using System.Drawing;
using System.Windows.Forms;

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

    public Form1()
    {
        this.tabControl1 = new TabControl();
        this.tabPage1 = new TabPage();

        // Gets the controls collection for tabControl1.
        // Adds the tabPage1 to this collection.
        this.tabControl1.TabPages.Add(tabPage1);

        this.tabControl1.Location = new Point(25, 25);
        this.tabControl1.Size = new Size(250, 250);

        this.ClientSize = new Size(300, 300);
        this.Controls.Add(tabControl1);
    }

    static void Main() 
    {
        Application.Run(new Form1());
    }
}
Imports System.Drawing
Imports System.Windows.Forms

Public Class Form1
    Inherits Form
    Private tabControl1 As TabControl
    Private tabPage1 As TabPage

    Public Sub New()
        Me.tabControl1 = New TabControl()
        Me.tabPage1 = New TabPage()

        ' Gets the controls collection for tabControl1.
        ' Adds the tabPage1 to this collection.
        Me.tabControl1.TabPages.Add(tabPage1)

        Me.tabControl1.Location = New Point(25, 25)
        Me.tabControl1.Size = New Size(250, 250)

        Me.ClientSize = New Size(300, 300)
        Me.Controls.Add(tabControl1)
    End Sub

    Shared Sub Main()
        Application.Run(New Form1())
    End Sub
End Class

こちらもご覧ください

適用対象

Add(String, String)

ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs

指定したテキストとキーを持つタブ ページを作成し、コレクションに追加します。

public:
 void Add(System::String ^ key, System::String ^ text);
public void Add(string key, string text);
public void Add(string? key, string? text);
member this.Add : string * string -> unit
Public Sub Add (key As String, text As String)

パラメーター

key
String

タブ ページの名前。

text
String

タブ ページに表示するテキスト。

注釈

Name プロパティは、TabControl.TabPageCollection内のTabPageのキーに対応します。

新しく作成された TabPage がコレクションの末尾に追加されます。

適用対象

Add(String, String, Int32)

ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs

指定したキー、テキスト、およびイメージを持つタブ ページを作成し、コレクションに追加します。

public:
 void Add(System::String ^ key, System::String ^ text, int imageIndex);
public void Add(string key, string text, int imageIndex);
public void Add(string? key, string? text, int imageIndex);
member this.Add : string * string * int -> unit
Public Sub Add (key As String, text As String, imageIndex As Integer)

パラメーター

key
String

タブ ページの名前。

text
String

タブ ページに表示するテキスト。

imageIndex
Int32

タブ ページに表示するイメージのインデックス。

注釈

Name プロパティは、TabControl.TabPageCollection内のTabPageのキーに対応します。

imageIndex パラメーターは、TabControlImageList プロパティ内のイメージを参照します。

新しく作成された TabPage がコレクションの末尾に追加されます。

適用対象

Add(String, String, String)

ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs
ソース:
TabControl.TabPageCollection.cs

指定したキー、テキスト、およびイメージを持つタブ ページを作成し、コレクションに追加します。

public:
 void Add(System::String ^ key, System::String ^ text, System::String ^ imageKey);
public void Add(string key, string text, string imageKey);
public void Add(string? key, string? text, string imageKey);
member this.Add : string * string * string -> unit
Public Sub Add (key As String, text As String, imageKey As String)

パラメーター

key
String

タブ ページの名前。

text
String

タブ ページに表示するテキスト。

imageKey
String

タブ ページに表示するイメージのキー。

注釈

Name プロパティは、TabControl.TabPageCollection内のTabPageのキーに対応します。

imageKey パラメーターは、TabControlImageList プロパティ内のイメージを参照します。

新しく作成された TabPage がコレクションの末尾に追加されます。

適用対象