Cannot Change MDIChild Position/Size While Minimized/Maximized

ID Number: Q82878

1.00

WINDOWS

Summary:

When a MDI Child custom control is minimized (reduced to an icon),

attempting to change its position or size at run time by setting the

Top, Left, Height, or Width property will generate the following

Visual Basic error message:

Cannot Change MDIChild Position Or Size While Minimized Or

Maximized.

This valid error message will also be generated if the MDI child

window is maximized and you attempt to change the size of position of

the MDI child. You cannot change the position or size of a MDI child

window when it is minimized or maximized. These properties can be set

at run time in code or at design time for any MDI child window that is

not maximized or minimized to an icon.

This information applies to the MDI Child custom control supplied with

Microsoft Professional Toolkit for Microsoft Visual Basic programming

system version 1.0 for Windows.

More Information:

The following steps demonstrate that an error message is generated

when you attempt to change (at run time in code) the Left property of

an MDI child window that has been either reduced to an icon or

maximized (to the full size of the parent form).

1. Run Visual Basic, or from the File menu, choose New Project (ALT,

F, N) if Visual Basic is already running. Form1 is created by

default.

2. From the File menu, choose Add File. In the Files box, select the

MDICHILD.VBX custom control file. The MDI Child tool appears in the

toolbox.

3. Place an MDI Child window control on Form1.

4. Double-click on the form outside the MDI child window to open the

Code window.

5. Add the following code to the Form1 Click event:

Sub Form_Click ()

MDIchild1.Left = 0

End Sub

6. Press F5 to run the application.

7. Click the Control-menu box (in the upper left corner) of the MDI child

window, and choose Minimize.

8. Click directly on the form.

The following error message dialog box is generated:

Cannot Change MDIChild Position Or Size While Minimized Or Maximized

Additional reference words: 1.00