PRB: MDI Child Form Painted Twice When Moved Before Loaded (109801)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 3.0
This article was previously published under Q109801 SYMPTOMS
If you Load an MDI child form and then change the position or size of the
MDI child form, it gets painted twice -- once in a default starting
position and then in its final position.
CAUSE
When you access any properties of a form that is not currently loaded, the
form is loaded immediately. Note that the Move method simply sets the Left,
Top, Width, and Height form properties. Since MDI child forms cannot have
their Visible property False, they cannot be loaded without being Visible.
Therefore, when you try to set the position or size properties of an MDI
child form before showing it, the MDI child form appears in a default
position before your new settings take effect.
RESOLUTION
Initialize the position of MDI child forms from within their own Form_Load
event handler. The Form_Load event handler is executed before the form
actually becomes visible.
Modification Type: | Minor | Last Reviewed: | 1/8/2003 |
---|
Keywords: | kbprb KB109801 |
---|
|