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

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

Control.ControlCollection.RemoveAt メソッド

指定したインデックス位置にあるコントロール コレクションからコントロール削除します

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

解説解説
使用例使用例

派生クラス Panel の Control.ControlCollection 内のコレクション数が 0 より大きい場合に、コレクション内の最初Control削除するコード例次に示します。この例では、Form 上に、PanelButton、および 1 つ上のその他のコントロール作成されている必要がありますその他のコントロールPanel コントロール追加されPanel コントロールForm追加されます。ボタンクリックされると、パネル含まれている最初コントロールControl.ControlCollection から削除されます。

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


このページでは「.NET Framework クラス ライブラリ リファレンス」からControl.ControlCollection.RemoveAt メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からControl.ControlCollection.RemoveAt メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からControl.ControlCollection.RemoveAt メソッド を検索

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS