Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Right click

Posted on 1998-10-05
3
Medium Priority
?
150 Views
Last Modified: 2010-05-03
I am using a technique for right click.  Make the menu invisible, the use popupmenu to make the menu pop up on a right click.  The problem is this only works on the form, it does not work on any control.  I need to select from the list box.  (for example left click will take the item and put it in another list box, right click needs to perform a different function)

When it gets down to it, the only thing i need is code to make the right click work over a control.


thanks
Specialist
0
Comment
Question by:SPECIALIST
3 Comments
 
LVL 2

Accepted Solution

by:
Jagar earned 210 total points
ID: 1438181
So in the MouseUp Event of the textbox show the menu.
0
 
LVL 3

Author Comment

by:SPECIALIST
ID: 1438182
thanks for your help,

The problem I am having, is on a right click, I need it to send that text to a textbox.  it does not select the item that is click on, any way to fix this?


0
 

Expert Comment

by:aldo_pmp
ID: 1438183
Use this general function in one mudule
Public Sub OpenContextMenu(FormName As Form, MenuName As Menu)

  Call SendMessage(FormName.hwnd, WM_RBUTTONDOWN, 0, 0&)
  'Show my context menu
  FormName.PopupMenu MenuName
   
End Sub

 and this code in the MouseDown event of your object

If Button = vbRightButton Then
    PopupMenu menu_name
End If

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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, 10 hours left to enroll

916 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