BaseFormShowMdiChild Method

Shows the form as an MDI child, owned by of this BaseForm. This BaseForm must be either an MDI container or another MDI child.

Definition

Namespace: KGySoft.WinForms.Forms
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
public void ShowMdiChild(
	Form child,
	bool suspendCaller = false
)

Parameters

child  Form
The child to show as an MDI child.
suspendCaller  Boolean  (Optional)
When , and the current BaseForm is also an MDI child, the current form will be suspended until the child is closed as if this form was the owner of the new MDI child. This parameter is optional. Default value: .

Remarks

Normally MDI children cannot be opened as dialogs. By setting suspendCaller to , a dialog-like behavior can be achieved, as the caller will be suspended until the child is closed. The child will not be a modal form, so you still will be able to interact with the parent form and other non-suspended child forms.

As the child form is not opened as a real dialog, this call returns immediately after the child is shown. You can use the OwnedMdiChildClosed event or the OnOwnedMdiChildClosed method to get notified when the child form is closed.

  Tip

See also the example application that contains an example for working with MDI forms.
The example is located under the Misc Tests / MDI Form Example menu.

Exceptions

ArgumentNullExceptionchild is .
InvalidOperationExceptionThis form is neither an MDI container nor an MDI child that can own the new child.
-or-
suspendCaller is when this form is already suspended.

See Also