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

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

Control.ControlCollection.Remove メソッド

指定したコントロールコントロール コレクションから削除します

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

解説解説
使用例使用例

Control派生クラス PanelControl.ControlCollectionメンバである場合に、そのコントロールコレクションから削除するコード例次に示します。この例では、Form 上に、PanelButton、および少なくとも 1 つRadioButton コントロール作成されている必要がありますRadioButton コントロールPanel コントロール追加されPanel コントロールForm追加されます。ボタンクリックされると、radioButton2 という名前のオプション ボタンControl.ControlCollection から削除されます。

' Remove the RadioButton control if it exists.
Private Sub RemoveButton_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 RemoveButton.Click
    If Panel1.Controls.Contains(RadioAddRangeButton) Then
        Panel1.Controls.Remove(RadioAddRangeButton)
    End If
End Sub
// Remove the RadioButton control if it exists.
private void removeButton_Click(object sender,
 System.EventArgs e)
{
   if(panel1.Controls.Contains(removeButton))
   {
      panel1.Controls.Remove(removeButton);
   }
}
   // Remove the RadioButton control if it exists.
private:
   void removeButton_Click( Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      if ( panel1->Controls->Contains( removeButton ) )
      {
         panel1->Controls->Remove( removeButton );
      }
   }
// Remove the RadioButton control if it exists.
private void removeButton_Click(Object sender,
 System.EventArgs e)
{
    if (panel1.get_Controls().Contains(removeButton)) {
        panel1.get_Controls().Remove(removeButton);
    }
} //removeButton_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Control.ControlCollection クラス
Control.ControlCollection メンバ
System.Windows.Forms 名前空間
RemoveAt
Clear
Add



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS