Form.IsMdiContainer プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As Form Dim value As Boolean value = instance.IsMdiContainer instance.IsMdiContainer = value
/** @property */ public boolean get_IsMdiContainer () /** @property */ public void set_IsMdiContainer (boolean value)
public function get IsMdiContainer () : boolean public function set IsMdiContainer (value : boolean)
フォームが MDI 子フォームのコンテナである場合は true。それ以外の場合は false。既定値は false です。

このプロパティは、フォームの表示と動作を変更し、そのフォームを MDI 親フォームにします。このプロパティを true に設定すると、フォームには、くぼんだクライアント領域が浮き出した境界線で囲まれて表示されます。親フォームへ割り当てられているすべての MDI 子フォームは、親のクライアント領域内に表示されます。
MDI 親フォームが閉じると、MDI 親フォームの Closing イベントが発生する前に、すべての MDI 子フォームの Closing イベントが発生します。さらに、MDI 親フォームの Closed イベントが発生する前に、すべての MDI 子フォームの Closed イベントが発生します。

IsMdiContainer プロパティを使用して、MDI フォームの BackColor プロパティを変更するコード例を次に示します。この例を実行するには、次のコードを新しいフォームに貼り付けます。
' Create a new form. Dim mdiChildForm As New Form Private Sub Form1_Load(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles MyBase.Load ' Set the IsMdiContainer property to true. IsMdiContainer = True ' Set the child form's MdiParent property to ' the current form. mdiChildForm.MdiParent = Me 'Call the method that changes the background color. SetBackGroundColorOfMDIForm() End Sub Private Sub SetBackGroundColorOfMDIForm() Dim ctl As Control ' Loop through controls, ' looking for controls of MdiClient type. For Each ctl In Me.Controls If TypeOf (ctl) Is MdiClient Then ' If the control is the correct type, ' change the color. ctl.BackColor = System.Drawing.Color.PaleGreen End If Next End Sub
// Create a new form. Form mdiChildForm = new Form(); private void Form1_Load(object sender, System.EventArgs e) { // Set the IsMdiContainer property to true. IsMdiContainer = true; // Set the child form's MdiParent property to // the current form. mdiChildForm.MdiParent = this; // Call the method that changes the background color. SetBackGroundColorOfMDIForm(); } private void SetBackGroundColorOfMDIForm() { foreach ( Control ctl in this.Controls ) { if ((ctl) is MdiClient) // If the control is the correct type, // change the color. { ctl.BackColor = System.Drawing.Color.PaleGreen; } } }
// Create a new form. private Form mdiChildForm = new Form(); private void Form1_Load(Object sender, System.EventArgs e) { // Set the IsMdiContainer property to true. set_IsMdiContainer(true); // Set the child form's MdiParent property to // the current form. mdiChildForm.set_MdiParent(this); // Call the method that changes the background color. SetBackGroundColorOfMDIForm(); } //Form1_Load private void SetBackGroundColorOfMDIForm() { for (int iCtr = 0; iCtr < this.get_Controls().get_Count(); iCtr++) { Control ctl = this.get_Controls().get_Item(iCtr); if (ctl instanceof MdiClient) { // If the control is the correct type, // change the color. ctl.set_BackColor(System.Drawing.Color.get_PaleGreen()); } } } //SetBackGroundColorOfMDIForm

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からForm.IsMdiContainer プロパティを検索する場合は、下記のリンクをクリックしてください。

- Form.IsMdiContainer プロパティのページへのリンク