Solved

Menu

Posted on 2000-05-17
5
208 Views
Last Modified: 2010-08-05
How can I part of my menu appear on the rigth click event, just like a popup menu ???
0
Comment
Question by:trick_jc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 9

Expert Comment

by:Ruchi
ID: 2819354
The following code would be used to display the Format menu when the user clicks the right mouse button on any open area of the form:

Private Sub Lable1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
    Me.PopupMenu popFormat
End If
End Sub


Place the code for the PopupMenu method in the MouseDown or MouseUp(((((typically the MouseUp))))) event of the form.

pop-up menu named popFormat

Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
    Me.PopupMenu popFormat
End If
End Sub
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2819358
"How to Mimic WordPerfect-Style 'Popup Button' Menus"
http://www.mvps.org/vbnet/code/menu/wpmnubuttons.htm
0
 
LVL 9

Accepted Solution

by:
Ruchi earned 50 total points
ID: 2819373
If you like to get a tutorial on "Visual Basic Menus"
http://www.vbinformation.com/tut-menu.htm
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2819406
if you want the menu to popup when the user clicks anywhere on the form, use the Form's MouseUp Event.  if you want it to popup only on a specific control, use that controls MouseUp event.  if you want this popup menu to only be visible as a popup, and not show up on your regular menu bar, set the top level menu item's visible property to false. e.g., a menu like this:

File
   Save
   Open
PopUp
   PopupItem1
   popupItem2


set PopUp's visible property to false and it wont show up in your menu bar...but use this code, and it will show its elements on a right click event of the form:

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbRightButton Then _
        Me.PopupMenu PopUp
End Sub

also I am using Popup as the name of the menu item as well as its caption.  its the name that you pass to the PopupMenu method
0
 

Author Comment

by:trick_jc
ID: 2819415
THANK'S !!!!!!!!!!!!!!!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question