ToolBar.ToolBarButtonCollection クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


ToolBar.ToolBarButtonCollection は、ツール バーに割り当てられたすべての ToolBarButton コントロールを格納するために ToolBar によって使用される、0 から始まるインデックス番号が付いたコレクションです。ボタンを個別に追加する場合は Add メソッドを使用し、ボタンを削除する場合は Remove メソッドを使用します。コレクションからすべてのボタンを削除するには、Clear メソッドを呼び出します。

ToolBar と 3 つの ToolBarButton コントロールを作成および初期化するコード例を次に示します。ツール バー ボタンはツール バーに割り当てられ、ツール バーはフォームに追加されます。このコードは、Form が既に作成されていることを前提にしています。
Public Sub InitializeMyToolBar() ' Create and initialize the ToolBarButton controls and ToolBar. Dim toolBar1 As New ToolBar() Dim toolBarButton1 As New ToolBarButton() Dim toolBarButton2 As New ToolBarButton() Dim toolBarButton3 As New ToolBarButton() ' Set the Text properties of the ToolBarButton controls. toolBarButton1.Text = "Open" toolBarButton2.Text = "Save" toolBarButton3.Text = "Print" ' Add the ToolBarButton controls to the ToolBar. toolBar1.Buttons.Add(toolBarButton1) toolBar1.Buttons.Add(toolBarButton2) toolBar1.Buttons.Add(toolBarButton3) ' Add the ToolBar to the Form. Controls.Add(toolBar1) End Sub
public void InitializeMyToolBar() { // Create and initialize the ToolBarButton controls and ToolBar. ToolBar toolBar1 = new ToolBar(); ToolBarButton toolBarButton1 = new ToolBarButton(); ToolBarButton toolBarButton2 = new ToolBarButton(); ToolBarButton toolBarButton3 = new ToolBarButton(); // Set the Text properties of the ToolBarButton controls. toolBarButton1.Text = "Open"; toolBarButton2.Text = "Save"; toolBarButton3.Text = "Print"; // Add the ToolBarButton controls to the ToolBar. toolBar1.Buttons.Add(toolBarButton1); toolBar1.Buttons.Add(toolBarButton2); toolBar1.Buttons.Add(toolBarButton3); // Add the ToolBar to the Form. Controls.Add(toolBar1); }
public: void InitializeMyToolBar() { // Create and initialize the ToolBarButton controls and ToolBar. ToolBar^ toolBar1 = gcnew ToolBar; ToolBarButton^ toolBarButton1 = gcnew ToolBarButton; ToolBarButton^ toolBarButton2 = gcnew ToolBarButton; ToolBarButton^ toolBarButton3 = gcnew ToolBarButton; // Set the Text properties of the ToolBarButton controls. toolBarButton1->Text = "Open"; toolBarButton2->Text = "Save"; toolBarButton3->Text = "Print"; // Add the ToolBarButton controls to the ToolBar. toolBar1->Buttons->Add( toolBarButton1 ); toolBar1->Buttons->Add( toolBarButton2 ); toolBar1->Buttons->Add( toolBarButton3 ); // Add the ToolBar to the Form. Controls->Add( toolBar1 ); }
public void InitializeMyToolBar() { // Create and initialize the ToolBarButton controls and ToolBar. ToolBar toolBar1 = new ToolBar(); ToolBarButton toolBarButton1 = new ToolBarButton(); ToolBarButton toolBarButton2 = new ToolBarButton(); ToolBarButton toolBarButton3 = new ToolBarButton(); // Set the Text properties of the ToolBarButton controls. toolBarButton1.set_Text("Open"); toolBarButton2.set_Text("Save"); toolBarButton3.set_Text("Print"); // Add the ToolBarButton controls to the ToolBar. toolBar1.get_Buttons().Add(toolBarButton1); toolBar1.get_Buttons().Add(toolBarButton2); toolBar1.get_Buttons().Add(toolBarButton3); // Add the ToolBar to the Form. get_Controls().Add(toolBar1); } //InitializeMyToolBar

System.Windows.Forms.ToolBar.ToolBarButtonCollection


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ToolBar.ToolBarButtonCollection コンストラクタ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


通常は、ToolBar.ToolBarButtonCollection を作成して、そのコンストラクタを明示的に呼び出す必要はありません。ToolBar コントロールの Buttons プロパティを参照すると、ToolBar.ToolBarButtonCollection が作成されます。その後、オブジェクトのプロパティおよびメソッドにアクセス可能となり、コレクションに ToolBarButton コントロールを割り当てることができます。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ToolBar.ToolBarButtonCollection クラス
ToolBar.ToolBarButtonCollection メンバ
System.Windows.Forms 名前空間
ToolBarButton
ToolBar.ToolBarButtonCollection プロパティ
ToolBar.ToolBarButtonCollection メソッド

名前 | 説明 | |
---|---|---|
![]() | Add | オーバーロードされます。 新しいツール バー ボタンをツール バー ボタン コレクションの末尾に追加します。 |
![]() | AddRange | ツール バー ボタンのコレクションをこのツール バー ボタン コレクションに追加します。 |
![]() | Clear | ツール バー ボタン コレクションからすべてのボタンを削除します。 |
![]() | Contains | 指定したツール バー ボタンがコレクションのメンバかどうかを確認します。 |
![]() | ContainsKey | 指定したキーの ToolBarButton がコレクション内にあるかどうかを判断します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetEnumerator | ツール バー ボタン コレクションを反復処理するために使用できる列挙子を返します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | IndexOf | コレクション内の指定したツール バー ボタンのインデックスを取得します。 |
![]() | IndexOfKey | 指定したキーを持つ ToolBarButton が最初に出現するインデックスを取得します。 |
![]() | Insert | ツール バー ボタン コレクション内の指定した位置に既存のツール バー ボタンを挿入します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | Remove | ツール バー ボタン コレクションから指定したボタンを削除します。 |
![]() | RemoveAt | ツール バー ボタン コレクションから指定したボタンを削除します。 |
![]() | RemoveByKey | 指定したキーの ToolBarButton をコレクションから削除します。 |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.Collections.ICollection.CopyTo | ICollection の要素を Array にコピーします。Array の特定のインデックスからコピーが開始されます。 |
![]() | System.Collections.IList.Add | 指定されたツール バー ボタンをツール バー ボタン コレクションの末尾に追加します。 |
![]() | System.Collections.IList.Contains | コレクションに特定の値が格納されているかどうかを判断します。 |
![]() | System.Collections.IList.IndexOf | コレクション内での指定した項目のインデックスを調べます。 |
![]() | System.Collections.IList.Insert | ツール バー ボタン コレクション内の指定した位置に既存のツール バー ボタンを挿入します。 |
![]() | System.Collections.IList.Remove | 最初に出現する項目をコレクションから削除します。 |

ToolBar.ToolBarButtonCollection メンバ
ToolBar クラスによって使用される ToolBarButton コントロールのコレクションをカプセル化します。
ToolBar.ToolBarButtonCollection データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | ToolBar.ToolBarButtonCollection | ToolBar.ToolBarButtonCollection クラスの新しいインスタンスを初期化し、指定されたツール バーに割り当てます。 |


名前 | 説明 | |
---|---|---|
![]() | Add | オーバーロードされます。 新しいツール バー ボタンをツール バー ボタン コレクションの末尾に追加します。 |
![]() | AddRange | ツール バー ボタンのコレクションをこのツール バー ボタン コレクションに追加します。 |
![]() | Clear | ツール バー ボタン コレクションからすべてのボタンを削除します。 |
![]() | Contains | 指定したツール バー ボタンがコレクションのメンバかどうかを確認します。 |
![]() | ContainsKey | 指定したキーの ToolBarButton がコレクション内にあるかどうかを判断します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetEnumerator | ツール バー ボタン コレクションを反復処理するために使用できる列挙子を返します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | IndexOf | コレクション内の指定したツール バー ボタンのインデックスを取得します。 |
![]() | IndexOfKey | 指定したキーを持つ ToolBarButton が最初に出現するインデックスを取得します。 |
![]() | Insert | ツール バー ボタン コレクション内の指定した位置に既存のツール バー ボタンを挿入します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | Remove | ツール バー ボタン コレクションから指定したボタンを削除します。 |
![]() | RemoveAt | ツール バー ボタン コレクションから指定したボタンを削除します。 |
![]() | RemoveByKey | 指定したキーの ToolBarButton をコレクションから削除します。 |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.Collections.ICollection.CopyTo | ICollection の要素を Array にコピーします。Array の特定のインデックスからコピーが開始されます。 |
![]() | System.Collections.IList.Add | 指定されたツール バー ボタンをツール バー ボタン コレクションの末尾に追加します。 |
![]() | System.Collections.IList.Contains | コレクションに特定の値が格納されているかどうかを判断します。 |
![]() | System.Collections.IList.IndexOf | コレクション内での指定した項目のインデックスを調べます。 |
![]() | System.Collections.IList.Insert | ツール バー ボタン コレクション内の指定した位置に既存のツール バー ボタンを挿入します。 |
![]() | System.Collections.IList.Remove | 最初に出現する項目をコレクションから削除します。 |
![]() | System.Collections.IList.Item | 指定したインデックスにある項目を取得または設定します。 |

Weblioに収録されているすべての辞書からToolBar.ToolBarButtonCollectionを検索する場合は、下記のリンクをクリックしてください。

- ToolBar.ToolBarButtonCollectionのページへのリンク