devxlogo

Showing and enumerating MDI child forms

Showing and enumerating MDI child forms

An MDI child form is a regular form whose MdiParent property points to its MDI container form, so the code that creates and displays a child window is very simple:

Sub ShowMdiChildWindow()    ' Display the MenuForm form as a child of this form.    Dim frm As New MenuForm()    ' Make it a child of this MDI form before showing it.    frm.MdiParent = Me    frm.Show()End Sub

A form that can be used either as a regular form or an MDI child form might need to determine how it’s being used. It can do that by testing its MdiParent property or its read-only IsMdiChild property.You can list all the child forms of an MDI parent by using the Form array returned by its MdiChildren property:

Dim frm As FormFor Each frm In Me.MdiChildren    Debug.Write(frm.Text)Next

See also  Professionalism Starts in Your Inbox: Keys to Presenting Your Best Self in Email
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist