Solved

Right click

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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
vb6 connector to mongodb 2 141
Access Object Property from VBA Module in Excel 2010 2 40
VB6 - Convert HH:MM into Decimal 8 70
vb6 - Transfer from MSHFlexgrid1 to xls issue 8 61
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 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