Form.ActiveMdiChild Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the currently active multiple-document interface (MDI) child window.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[<BrowsableAttribute(false)>]
member ActiveMdiChild : Form with get

Property Value

Type: System.Windows.Forms.Form

Returns a Form that represents the currently active MDI child window, or null if there are currently no child windows present.

You can use this method to determine whether there are any MDI child forms open in your MDI application. You can also use this method to perform operations on an MDI child window from its MDI parent form or from another form that is displayed in your application.

If the currently active form is not an MDI child form, you can use the ActiveForm property to obtain a reference to it.

The following code example obtains a reference to the active MDI child form and loops through all TextBox controls on the form, resetting their Text properties. This example requires that an MDI parent form has been created and that this method call is being made from the MDI parent form.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: