Microsoft KB Archive/98197

= BUG: Forms Lose Order and Modality after SCREEN.SHOW =

PSS ID Number: 98197

Article Last Modified on 1/8/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q98197



SYMPTOMS
When you hide all forms and then show all forms using SCREEN.HIDE and SCREEN.SHOW, two problems occur:


 * The z-order of the forms is not preserved correctly. In other words, the order in which forms overlap each other may change so that now a different form appears on top.
 * Modal forms incorrectly become non-modal.



WORKAROUND
To work around the problem with z-order, explicitly use SHOW to show each form in the order that you want them to appear after using SCREEN.SHOW.

To work around the problem with losing modality, use SHOW to show the form modally after using SCREEN.HIDE. This only works if there is only a single modal form.



STATUS
Microsoft has confirmed this to be a bug in the Standard and Professional Editions of Microsoft Visual Basic version 1.0 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Problem
 Start the Form Designer. In VBDOS.EXE, from the File menu, choose New Project (ALT+F, N). Create two forms (Form1 and Form2).  Enter the following code in Form1: SUB Form_Click Form2.SHOW 1 END SUB   Enter the following code in Form2. SUB Form_Click ' Form2.Hide     ' remove the comment to work around the problem SCREEN.HIDE SLEEP SCREEN.SHOW ' Form2.SHOW 1   ' remove the comment to work around the problem END SUB  Run the program. Click Form1 to show Form2. Clicking Form1 causes a beep, as it should, because Form2 is modal. Click Form2. The forms are hidden.</li> Press a key to restore the forms. Form1 is incorrectly positioned on top of Form2, which has become non-modal.</li></ol>

Additional query words: VBmsdos buglist1.00 1.00

Keywords: kbbug KB98197

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

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

© 2004 Microsoft Corporation. All rights reserved.