BUG: Click Event May Fail to Occur in Cascading Menu

ID: Q80023


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for Windows, versions 2.0, 3.0
  • Microsoft Visual Basic programming system for Windows, version 1.0


SYMPTOMS

There is an inconsistency with the Click events of cascading menus in Visual Basic. This problem occurs when hidden menus are displayed.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base 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 a set of menus using the following table as a guide:
    
       Caption     CtlName (or Name)  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. Add two command buttons (Command1 and Command2) to the form.


  3. Add the following code to your program in the appropriate places:
    
       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 the A menu, then click the 1 menu. Notice that "Cascade 1" is printed to the form. Note that you may have to do this twice because the menu overlaps the display and erases most of it the first time.


  6. Click the Command2 button to hide the A menu and show the B menu. Click the B menu, then click the 2 menu. Notice "Cascade 2" does not print to the screen as it did in step 5 above.


Additional query words: buglist1.00 buglist2.00 buglist3.00 2.00 3.00

Keywords :
Version : WINDOWS:1.0,2.0,3.0
Platform : WINDOWS
Issue type :


Last Reviewed: January 25, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.