Solved

Displaying my context menu with a left click

Posted on 2000-03-02
5
214 Views
Last Modified: 2008-03-17
A button in my application has a shortcut menu associated with it.
This menu is opened when the button is right-clicked.

How can I change this so that clicking with the left button also opens the menu??

I cannot find any On RButtonDown or equivalent method any ideas guys and gals?
0
Comment
Question by:neilhoman
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:brewdog
ID: 2577083
So if the user clicks either button anywhere in the app, you want the menu to pop up? Wouldn't you want the menu just in certain places with the left mouse? Otherwise users will never be able to click command buttons, etc. . . .
0
 
LVL 54

Expert Comment

by:nico5038
ID: 2577588
Can't figure out why this right-click is button-bound?
Is the short-cut menu only visible when this button is right clicked or also when you right-click anywhere else?
On my forms a right-click normally shows the filter-menu!
Perhaps it would help if you would show the code 'behind' the button.
0
 

Author Comment

by:neilhoman
ID: 2579710
Sorry for taking so long to reply my email notification or the account itself does not seem to be working.....

First of all I created a button. Now when I press this button I want to show a context menu.
So I went about setting one up using the customise toolbar menu. I made it a shortcut menu.

Now in the properties for the button I set the shortcut menu property to the name of my shortcut menu.

So now when I right click on the button my shortcut menu is displayed. Only problem is - I want the shortcut menu to be displayed when I Left click on the button as well.

To do this in C++, as I was saying, you would simply add a handler for Left_Button_Click and from there (to call the shortcut menu) I would simply place a call to the RButton down() function to evoke the handler code for the rightmouse click (from the left mouse handler) executing the right_mouse click code effectively showing my shortcut menu.

Thing is I dont know how to do it in access.

Sorry for not being clear in my first description.
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 10 total points
ID: 2580017
Try for a button named Command45:

Private Sub Command45_Click()
    SendKeys "+{F10}"
End Sub
0
 

Author Comment

by:neilhoman
ID: 2580353
Bit of a work around but thanks very very much Nico..... keep up d good work!
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

759 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now