VB Menu Can Cover Top of MDI Child Control when BorderStyle=0

ID Number: Q83858

1.00

WINDOWS

buglist1.00

Summary:

An MDI child window that contains a frame, has its BorderStyle

property set to 0 (none), and is maximized, will appear to slip under

and be partially masked by the title bar of the parent form when the

parent form has a menu.

Microsoft has confirmed this to be a problem with the MDI Child custom

control supplied with Microsoft Professional Toolkit for Microsoft

Visual Basic programming system version 1.0 for Windows. Microsoft is

researching this problem and will post new information here as it

becomes available.

More Information:

Because an MDI Child control with a BorderStyle of 0 (none) cannot be

maximized by the user (there is no Control-menu box for the control), you

must use one of two methods to reproduce the problem:

- You can maximize an MDI Child window that has a BorderStyle of 0

(none) by pressing CTRL+BREAK and setting the WindowState to 2

(maximized) in the Immediate window.

-or-

- Set the MDI Child control WindowState property to 2 in code.

The following example uses the former method.

Steps to Reproduce Problem

--------------------------

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 New File. In the Files box, select the

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

the Toolbox.

Using the mouse, do the following:

3. Click on the Toolbox to select the MDI Child control.

4. Click and drag on the form to place an MDI Child Window control.

5. Click on the Toolbox to select the frame control.

6. Click and drag on the MDI Child window to place the frame control.

Place the frame at coordinates 0,0 (top left corner of the MDI

Child window).

7. Click on the MDI child window, choose the BorderStyle property

from the Properties bar, and set it to 0 (None).

8. From the Window menu, choose Menu Design Window to add a menu to

the parent form.

9. In the Menu Design dialog box, type "Foo" on the caption line and

again on the CtlName line. Choose the Done button.

10. From the Run menu, choose Start to run the application.

11. Press CTRL+BREAK to break out of run mode.

12. Open the Immediate window, and type the following to maximize the

MDI Child window.

MDIChild1.WindowState = 2 'The maximized window style

Note: The MDIChild1 window will now occupy the whole form, and

the frame caption will no longer be visible because it is covered by

the menu bar. If there is no menu item, the maximized MDI Child window

positions itself correctly.

Additional reference words: 1.00 MDIChild MDI Child