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

x
?
Solved

Right click

Posted on 1998-10-05
3
Medium Priority
?
149 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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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

715 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