Microsoft KB Archive/89283

= PRB: Parent Menu Click Event May Hang Under Certain Conditions =

PSS ID Number: 89283

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 Q89283



SYMPTOMS
In the Click event of a parent menu (a menu that has child menus), you should only use statements that change child menu properties (Caption, Checked, Enabled, Separator, Tag, and Visible). Avoid using statements that perform the following types of actions, because they may give unpredictable results or cause the computer to hang (stop responding):


 * Cause other events (for example, DOEVENTS)
 * Change the focus (for example, SETFOCUS)
 * Affect higher level menus
 * Anything that could cause screen painting or updating including showing or hiding a form or ending the program.



STATUS
This behavior is by design.



Steps to Reproduce Problem
 Run the Form Designer. In VBDOS.EXE, from the File menu, choose New Form (ALT, F, F). From the Window menu, choose Menu Design Window. Enter Menu1 in the Caption field and in the CtlName field. Choose Next. Enter Menu2 in the Caption field and in the CtlName field. Click on the right arrow button to indent once. Choose Done. From the Edit Menu, choose Event Procedures. In the subsequent dialog box, choose OK. In the dialog box that asks if you want to save, choose Yes. In the Event Procedures dialog box, select Menu1 in the Objects box, and Click in the Events box. Choose the Edit in Active button.</li>  Enter the following code: SUB Menu1_Click t% = DOEVENTS END SUB </li> Press F5 to run the program. Click on Menu1.</li></ol>

The program causes the computer to hang (stop responding).

Additional query words: VBmsdos 1.00

Keywords: kbprb KB89283

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

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

© 2004 Microsoft Corporation. All rights reserved.