PRB: MDI Child Form Drawn Incorrectly with Missing Title Bar
Article ID: 138523
Article Last Modified on 12/9/2003
APPLIES TO
- Microsoft Visual Basic 3.0 Professional Edition
- Microsoft Visual Basic 4.0 Standard Edition
- Microsoft Visual Basic 3.0 Professional Edition
- Microsoft Visual Basic 4.0 Professional Edition
- Microsoft Visual Basic 4.0 Enterprise Edition
This article was previously published under Q138523
SYMPTOMS
If an MDI child form is maximized by setting the Windowstate property in
the Load event of the MDI parent form, then the child form may be drawn
incorrectly when first shown.
WORKAROUND
Resize the MDI parent form. Then the child form is drawn correctly with the
Title Bar, Control Box and Restore button.
Or set the height and width of the child form to the ScaleHeight and the
ScaleWidth of the MDI parent instead of using numerical values. For
example, the following code sizes the child to the same dimensions as the
MDI parent form, and then maximizes the form:
MDIForm1.Width = 6000
MDIForm1.Height = 3000
Form1.Width = MDIForm1.ScaleWidth
Form1.Height = MDIForm1.ScaleHeight
Form1.WindowState = 2 ' Maximize the child window
Replace the code in the MDIForm_Load procedure with this code to ensure
that the child form is painted correctly.
STATUS
Microsoft is researching this behavior and will post new information here
in the Microsoft Knowledge Base as it becomes available.
Additional query words: 4.00 3.00 MDI vb4win vb4all
Keywords: kbprb kbcode KB138523