In VB, Click Event May Fail to Occur in Cascading Menu

ID Number: Q80023

1.00

WINDOWS

buglist1.00

Summary:

There is an inconsistency with the Click events of cascading menus in

Visual Basic. This problem occurs when hidden menus are displayed.

Microsoft has confirmed this to be a problem in Visual Basic

programming system version 1.0 for Windows. We are researching this

problem and will post new information here as it becomes available.

More Information:

If you design menus with cascading menus, you can process the Click

event for the menu selection that cascades another submenu.

Conversely, if you initially design the menu so that the menu

Visible property is set to False, you will not always be able to

process the Click event for that menu selection that cascades another

menu.

Steps to Reproduce Problem

--------------------------

1. From the menu design dialog box of Visual Basic (VB.EXE), create

the following menu:

Caption CtlName Level Visible

------- ------- ----- -------

A MID_A 1 True

1 MID_ONE 2

Cascade 1 CASCADE1 3

B MID_B 1 FALSE

2 MID_TWO 2

Cascade 2 CASCADE2 3

2. Create the following controls:

Control CtlName

------- -------

Command button Command1

Command button Command2

3. Add the following code to your program in the appropriate place:

Sub Command1_Click ()

MID_A.Visible = -1

MID_B.Visible = 0

End Sub

Sub Command2_Click ()

MID_A.Visible = 0

MID_B.Visible = -1

End Sub

Sub MID_TWO_Click ()

Print "Cascade 2"

End Sub

Sub MID_ONE_Click ()

Print "Cascade 1"

End Sub

4. Run the program.

5. Click on the "A" menu, then click on the "1" menu. Notice that

"Cascade 1" is printed to the form. (You may have to do this twice

because the menu overlaps the display and erases most of it the

fist time).

6. Click on Command2; this will hide the "A" menu and show the "B"

menu. Click on the "B" menu, then click on the "2" menu. Notice

the "Cascade 2" does not print to the screen as it did in step 5

above.

Additional reference words: 1.00