BUG: Click Event May Fail to Occur in Cascading Menu

Last reviewed: June 21, 1995
Article ID: Q80023
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, versions 2.0 and 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 reference words: buglist1.00 buglist2.00 buglist3.00 1.00 2.00
3.00
KBCategory: kbprg kbbuglist
KBSubcategory: PrgCtrlsStd


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.