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

Form.MdiParent プロパティ

対象となるフォーム現在のマルチ ドキュメント インターフェイス (MDI) 親フォーム取得または設定します

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

Dim instance As Form
Dim value As Form

value = instance.MdiParent

instance.MdiParent = value
public Form MdiParent { get; set;
 }
public:
property Form^ MdiParent {
    Form^ get ();
    void set (Form^ value);
}
/** @property */
public Form get_MdiParent ()

/** @property */
public void set_MdiParent (Form value)

プロパティ
MDIフォームを表す Form

例外例外
解説解説
使用例使用例

MDI アプリケーションに子フォーム作成する方法次のコード例示します。このコード例では、子フォーム特定するための一意テキストを持つフォーム作成します。そして、MdiParent プロパティ使用してフォームが子フォームであることを指定します。この例は、IsMdiContainer プロパティtrue設定されフォームからコード呼び出されていること、および、フォームchildCount というプライベートなクラス レベル整数変数を持つことを前提にしています。

Private Sub CreateMyChildForm()
   ' Create a new form to represent the child form.
   Dim child As New Form()
   ' Increment the private child count.
   childCount += 1
   ' Set the text of the child form using the count of child forms.
   Dim formText As String
 = "Child " + childCount.ToString()
   child.Text = formText

   ' Make the new form a child form.
   child.MdiParent = Me
   ' Display the child form.
   child.Show()
End Sub
private void CreateMyChildForm ()
{
   // Create a new form to represent the child form.
   Form child = new Form();
   // Increment the private child count.
   childCount++;
   // Set the text of the child form using the count of child forms.
   String formText = "Child " + childCount;
   child.Text = formText;

   // Make the new form a child form.
   child.MdiParent = this;
   // Display the child form.
   child.Show();
}
private:
   void CreateMyChildForm()
   {
      // Create a new form to represent the child form.
      Form^ child = gcnew Form;

      // Increment the private child count.
      childCount++;

      // Set the text of the child form using the count of child forms.
      String^ formText = String::Format( "Child {0}", childCount );
      child->Text = formText;

      // Make the new form a child form.
      child->MdiParent = this;

      // Display the child form.
      child->Show();
   }
private void CreateMyChildForm()
{
    // Create a new form to represent the child form.
    Form child = new Form();

    // Increment the private child count.
    childCount++;

    // Set the text of the child form using the count of child forms.
    String formText = "Child " + childCount;
    child.set_Text(formText);

    // Make the new form a child form.
    child.set_MdiParent(this);

    // Display the child form.
    child.Show();
} //CreateMyChildForm
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

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

   

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



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

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

©2025 GRAS Group, Inc.RSS