Share via


How to: Display a Child Form Inside a Top-Level Form

If you've created a child form in which the ShowWindow Property is set to 1  In Top-Level Form, you don't directly specify the top-level form that acts as the child form's parent. Instead, Visual FoxPro assigns the child form to a parent at the time the child window is displayed.

To display a child form inside a top-level form

  1. Create a top-level form.

  2. In the event code of the top-level form, include the DO FORM Command, specifying the name of the child form to display.

    For example, create a button in the top-level form, and then in the Click Event code for the button, include a command such as this one:

    DO FORM MyChild
    

    Note

    The top-level form must be visible and active when the child form is displayed. Therefore, you cannot use the Init Event of the top-level form to display a child form, because the top-level form will not yet be active.

  3. Activate the top-level form, and then if necessary, trigger the event that displays the child form.

See Also

Tasks

How to: Specify a Form Type

How to: Hide the Main Visual FoxPro Window

How to: Add a Menu to a Top-Level Form

How to: Extend Forms with Form Sets

Concepts

Creation of Single- and Multiple-Document Interfaces

Other Resources

Creating Forms