Form.ControlCollection クラスとは? わかりやすく解説

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

Form.ControlCollection クラス

フォーム上のコントロールコレクション表します

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

<ComVisibleAttribute(False)> _
Public Class ControlCollection
    Inherits ControlCollection
Dim instance As ControlCollection
[ComVisibleAttribute(false)] 
public class ControlCollection : ControlCollection
[ComVisibleAttribute(false)] 
public ref class ControlCollection : public
 ControlCollection
/** @attribute ComVisibleAttribute(false) */ 
public class ControlCollection extends ControlCollection
ComVisibleAttribute(false) 
public class ControlCollection extends
 ControlCollection
解説解説
使用例使用例

TextBox コントロールLabel コントロールフォームコントロール コレクション追加するコード例次に示します。この例では、フォームForm1 という名前で作成されている必要があります

Public Sub AddMyControls()
    Dim textBox1 As New
 TextBox()
    Dim label1 As New Label()
    
    ' Initialize the controls and their bounds.
    label1.Text = "First Name"
    label1.Location = New Point(48, 48)
    label1.Size = New Size(104, 16)
    textBox1.Text = ""
    textBox1.Location = New Point(48, 64)
    textBox1.Size = New Size(104, 16)
    
    ' Add the TextBox control to the form's control collection.
    Controls.Add(textBox1)
    ' Add the Label control to the form's control collection.
    Controls.Add(label1)
End Sub 'AddMyControls
public void AddMyControls()
 {
    TextBox textBox1 = new TextBox();
    Label label1 = new Label();
    
    // Initialize the controls and their bounds.
    label1.Text = "First Name";
    label1.Location = new Point(48,48);
    label1.Size = new Size (104, 16);
    textBox1.Text = "";
    textBox1.Location = new Point(48, 64);
    textBox1.Size = new Size(104,16);
 
    // Add the TextBox control to the form's control collection.
    Controls.Add(textBox1);
    // Add the Label control to the form's control collection.
    Controls.Add(label1);
 }
 
public:
   void AddMyControls()
   {
      TextBox^ textBox1 = gcnew TextBox;
      Label^ label1 = gcnew Label;
      
      // Initialize the controls and their bounds.
      label1->Text = "First Name";
      label1->Location = Point( 48, 48 );
      label1->Size = System::Drawing::Size( 104, 16 );
      textBox1->Text = "";
      textBox1->Location = Point(48,64);
      textBox1->Size = System::Drawing::Size( 104, 16 );
      
      // Add the TextBox control to the form's control collection.
      Controls->Add( textBox1 );
      // Add the Label control to the form's control collection.
      Controls->Add( label1 );
   }
継承階層継承階層
System.Object
   System.Windows.Forms.Layout.ArrangedElementCollection
     System.Windows.Forms.Control.ControlCollection
      System.Windows.Forms.Form.ControlCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Form.ControlCollection メンバ
System.Windows.Forms 名前空間
Control.ControlCollection クラス



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

辞書ショートカット

すべての辞書の索引

「Form.ControlCollection クラス」の関連用語

Form.ControlCollection クラスのお隣キーワード
検索ランキング

   

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



Form.ControlCollection クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS