Microsoft KB Archive/262029

= BUG: MenuClick Event for MenuBar Control Does Not Fire Correctly in eVB =

Article ID: 262029

Article Last Modified on 9/4/2002

-

APPLIES TO


 * Microsoft eMbedded Visual Basic 3.0

-



This article was previously published under Q262029



SYMPTOMS
When you click a top-level menu item, the MenuClick event of the MenuBar control does not fire correctly.



CAUSE
eMbedded Visual Basic (eVB) does not support firing events on top-level menus for the MenuBar control.



RESOLUTION
To work around this problem, use a button with a caption on the MenuBar or CommandBar instead of a top-level menu item. You can then process the Click event of the button.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
 Create a PocketPC project in eVB. Form1 is created by default. In the Project/Component dialog box, select the PocketPC MenuBar Control 3.0 check box to add it to the toolbox. Add an instance of the control to Form1.  Paste the following code into Form1: Private Sub Form_Activate Dim menuA As MenuBarMenu Set menuA = MenuBar1.Controls.AddMenu(&quot;Menu1&quot;) End Sub

Private Sub MenuBar1_MenuClick(ByVal Item As MenuBarLib.Item) MsgBox &quot;Menu item is clicked&quot; End Sub  Press the F5 key to run the application, and click Menu1 from the MenuBar control. Notice that no message box appears.</li></ol>

<div class="references_section">