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 INFORMATIONSteps 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.
- Enter the following code:
SUB Menu1_Click ()
t% = DOEVENTS()
END SUB
- 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 :
|