PRB: Parent Menu Click Event May Hang Under Certain Conditions

ID: Q89283


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0


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.


MORE INFORMATION

Steps to Reproduce Problem

  1. Run the Form Designer. In VBDOS.EXE, from the File menu, choose New Form (ALT, F, F).


  2. From the Window menu, choose Menu Design Window.


  3. Enter Menu1 in the Caption field and in the CtlName field. Choose Next.


  4. Enter Menu2 in the Caption field and in the CtlName field. Click on the right arrow button to indent once. Choose Done.


  5. 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.


  6. In the Event Procedures dialog box, select Menu1 in the Objects box, and Click in the Events box. Choose the Edit in Active button.


  7. Enter the following code:
    
       SUB Menu1_Click ()
          t% = DOEVENTS()
       END SUB 


  8. Press F5 to run the program. Click on Menu1.


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

Additional query words: VBmsdos 1.00

Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 10, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.