Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Menu

Posted on 2000-05-17
5
Medium Priority
?
209 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 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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

704 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