Microsoft KB Archive/129638

= PRB: Visible Controls on MDIChild Report as Invisible =

Article ID: 129638

Article Last Modified on 12/9/2003

-

APPLIES TO


 * Microsoft Visual Basic 4.0 Standard Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 16-bit Enterprise Edition
 * Microsoft Visual Basic 4.0 32-Bit Enterprise Edition

-



This article was previously published under Q129638



SYMPTOMS
If there are two MDI child forms that contain (visible) controls, and one of the forms is maximized and then closed, the visible properties for any controls on the remaining MDI child form will report False from the Resize event of that form.



CAUSE
Windows hides the MDI client briefly during a restore or close of a maximized MDI child. As a result, the other child form underneath the just closed child is indeed invisible. The status of the other MDI child form's controls is thus just being correctly reported.



RESOLUTION
This is a limitation of the implementation of MDI forms. However, to check the other MDI child form controls' Visible properties correctly, a timer control (with its Enabled property set to False at Design Time) can be enabled from the resize event of this other MDI child form. Checking the value of the control's Visible property from the timer event should result in a value of True.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Start a new project in Visual Basic. Form1 is created by default. From the Insert menu, choose MDI Form. MDIForm1 will be added. From the Insert menu, choose Form. Form2 will be added. Set the MDIChild property of both Form1 and Form2 to True.  In the Form_Load event of MDIForm1 add this code: Form2.Show </li> Add a text box (Text1) to Form2</li>  In the Form_Resize event for Form2, add this code: Debug.Print Text1.Visible </li> Press the F5 key to run the program. Maximize Form1. Choose Close from the system menu of Form1, and view the Debug Window. False will be printed as the value of Text1.Visible from Form2's Resize event.</li></ol>

Additional query words: 4.00 hidden vb4win vb4all

Keywords: kbprb KB129638

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.