Example Code

Creating a Child Window Inside a LabWindows/CVI Top-level Panel to Simulate Multiple Document Interface (MDI) Applications

Code and Documents

Attachment

This example demonstrates how to use LabWindows/CVI 6.0 to simulate a MDI application. To create a child window inside a LabWindows/CVI top-level panel, use the LabWindows/CVI built-in function LoadPanel(..).

This example contains two panels, showing a top-level panel as the child of another top-level panel. Both panels (parent and child) have the look and feel of a top-level window with the following exceptions:

1. The child panel can reside only within the boundaries of the parent panel.

2. The child panel looses some of its top-level window functionality, such as the maximize and minimize buttons found on the upper-right corner of any top-level window.

The only Windows SDK function used in this example is SetParent(). National Instruments recommends you use the LabWindows/CVI function LoadPanel() to set the parent handle of a panel rather than a Windows SDK function, as mixing SDK functions and LabWindows/CVI functions might have unexpected results.

LabWindows/CVI 5.x Users: This example was developed with LabWindows/CVI 6.0, and you might get errors if you try to load it in an environment other than LabWindows/CVI 6.0. However, you can still examine the source code provided.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors