ToolBar.ToolBarButtonCollection.Clear メソッド
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


Clear メソッドは、コレクションを反復処理して、ToolBar.ToolBarButtonCollection に割り当てられているすべてのツール バー ボタンを削除します。
コレクションからツール バー ボタンを個別に削除するには、Remove メソッドまたは RemoveAt メソッドを使用します。
新しい ToolBarButton オブジェクトをコレクションに追加するには、Add メソッド、AddRange メソッド、または Insert メソッドを使用します。

Clear メソッドが呼び出される前後に Buttons の Count を表示するコード例を次に示します。このコードは、少なくとも 1 つの ToolBarButton を持つ ToolBar が作成されていることを前提にしています。
Public Sub ClearMyToolBar() Dim btns As Integer ' Get the count before the Clear method is called. btns = toolBar1.Buttons.Count toolBar1.Buttons.Clear() MessageBox.Show("Count Before Clear: " + btns.ToString() & _ Microsoft.VisualBasic.ControlChars.Cr & "Count After Clear: " & _ toolBar1.Buttons.Count.ToString()) End Sub

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


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

- ToolBar.ToolBarButtonCollection.Clear メソッドのページへのリンク