Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB6.0

While I understand that left clicking on a label in an array will place the array index in the button variable of LabelName_Click(button As Integer) and it does, to my surprise this is also the case for right-click.

I wish to detect whether the mouse button clicked was right or left when clicking on any of the members of the label array.

Is is possible to do?

Thanks

:Ron
Posted

1 solution

I don't do VB6, due to a lack of self loathing, however, looking at this code, you're getting passed a parameter called 'button'. Surely that tells you which button was pressed ?
 
Share this answer
 
Comments
Ron Anders 30-Jan-12 22:47pm    
Param button is indeed the button pressed if I click on a picturebox or non array'ed label, but for an arrayed label the button param is: 0,1,2,3,4,5,6 etc whether I right click or left!

If I left click, we are dragging the form, if I right click I want to pop up my context menu which is the same regardless of which array item I click on in this application.
Christian Graus 30-Jan-12 22:48pm    
Is there a static method you can use to find out what mouse button is down ? I'm sure there is one in C++ you could call ? It does sound to me like VB6 is basically broken, but, I knew that :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900