Control.ControlCollection.Clear メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Control.ControlCollection.Clear メソッドの意味・解説 

Control.ControlCollection.Clear メソッド

コレクションからすべてのコントロール削除します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

解説解説
使用例使用例

派生クラス Panel の Control.ControlCollection に含まれるすべての Control オブジェクト削除するコード例次に示します。この例では、Form 上に、PanelButton、および 1 つ上のその他のコントロール作成されている必要がありますその他のコントロールPanel コントロール追加されPanelForm追加されます。ボタンクリックされると、パネル含まれているすべてのコントロールControl.ControlCollection から削除されます。

' Clear all the controls in the Panel.
Private Sub ClearButton_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 ClearButton.Click
    Panel1.Controls.Clear()
End Sub
// Clear all the controls in the Panel.
private void clearButton_Click(object sender,
 System.EventArgs e)
{
   panel1.Controls.Clear();
}
   // Clear all the controls in the Panel.
private:
   void clearButton_Click( Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      panel1->Controls->Clear();
   }
// Clear all the controls in the Panel.
private void clearButton_Click(Object sender,
 System.EventArgs e)
{
    panel1.get_Controls().Clear();
} //clearButton_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Control.ControlCollection クラス
Control.ControlCollection メンバ
System.Windows.Forms 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

Control.ControlCollection.Clear メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Control.ControlCollection.Clear メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS