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

x
?
Solved

Displaying my context menu with a left click

Posted on 2000-03-02
5
Medium Priority
?
227 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
[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
  • 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 30 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

730 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