Solved

Right click

Posted on 1998-10-05
3
144 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 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

747 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

10 Experts available now in Live!

Get 1:1 Help Now