Form.MdiChildren プロパティとは? わかりやすく解説

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

Form.MdiChildren プロパティ

対象フォームが親フォームであるマルチ ドキュメント インターフェイス (MDI) 子フォーム配列取得します

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

Dim instance As Form
Dim value As Form()

value = instance.MdiChildren
public Form[] MdiChildren { get; }
public:
property array<Form^>^ MdiChildren {
    array<Form^>^ get ();
}
/** @property */
public Form[] get_MdiChildren ()
public function get MdiChildren
 () : Form[]

プロパティ
Form オブジェクト配列。各オブジェクトが、対象となるフォームMDIフォーム示します

解説解説
使用例使用例

MdiChildren プロパティ使用してMDIフォームリスト反復処理し、すべてのフォームButton コントロール追加するコード例次に示します

Private Sub AddButtonsToMyChildren()
    ' If there are child forms in the parent form, add Button controls
 to them.
    Dim x As Integer
    For x = 0 To (Me.MdiChildren.Length)
 - 1
        ' Create a temporary Button control to add to the child form.
        Dim tempButton As New
 Button()
        ' Set the location and text of the Button control.
        tempButton.Location = New Point(10, 10)
        tempButton.Text = "OK"
        ' Create a temporary instance of a child form (Form 2 in this
 case).
        Dim tempChild As Form = CType(Me.MdiChildren(x),
 Form)
        ' Add the Button control to the control collection of the form.
        tempChild.Controls.Add(tempButton)
    Next x
End Sub 'AddButtonsToMyChildren
private void AddButtonsToMyChildren()
{
   // If there are child forms in the parent form, add Button controls
 to them.
   for (int x =0; x < this.MdiChildren.Length;x++)
   {
      // Create a temporary Button control to add to the child form.
      Button tempButton = new Button();
      // Set the location and text of the Button control.
      tempButton.Location = new Point(10,10);
      tempButton.Text = "OK";
      // Create a temporary instance of a child form (Form 2 in this
 case).
      Form tempChild = (Form)this.MdiChildren[x];
      // Add the Button control to the control collection of the form.
      tempChild.Controls.Add(tempButton);
   }
}
private:
   void AddButtonsToMyChildren()
   {
      // If there are child forms in the parent form, add Button controls
 to them.
      for ( int x = 0; x < this->MdiChildren->Length;
 x++ )
      {
         // Create a temporary Button control to add to the child form.
         Button^ tempButton = gcnew Button;

         // Set the location and text of the Button control.
         tempButton->Location = Point(10,10);
         tempButton->Text = "OK";

         // Create a temporary instance of a child form (Form 2 in this
 case).
         Form^ tempChild = dynamic_cast<Form^>(this->MdiChildren[
 x ]);

         // Add the Button control to the control collection of the
 form.
         tempChild->Controls->Add( tempButton );
      }
   }
private void AddButtonsToMyChildren()
{
    // If there are child forms in the parent form, add 
    // Button controls to them.
    for (int x = 0; x < this.get_MdiChildren().length;
 x++)
    {
        // Create a temporary Button control to add to the child form.
        Button tempButton = new Button();

        // Set the location and text of the Button control.
        tempButton.set_Location(new Point(10, 10));
        tempButton.set_Text("OK");

        // Create a temporary instance of a child form
        //(Form 2 in this case).
        Form tempChild = (Form)(this.get_MdiChildren().get_Item(x));

        // Add the Button control to the control collection of the form.
        tempChild.get_Controls().Add(tempButton);
    }
} //AddButtonsToMyChildren
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「Form.MdiChildren プロパティ」の関連用語

Form.MdiChildren プロパティのお隣キーワード
検索ランキング

   

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



Form.MdiChildren プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS