Solved

Right click

Posted on 1998-10-05
3
148 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
[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 Comments
 
LVL 2

Accepted Solution

by:
Jagar earned 70 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
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…
Suggested Courses
Course of the Month5 days, 9 hours left to enroll

627 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