How to add RIGHT-MOUSE-CLICK event?

Serge

New Member
Hi all,

I have a TreeView Control 6.0 (SP6) on my window (.w). In the Common OCX Events I see OCX.DblClick , OCX.Click, ...

but NO OCX.RightMouseClick ???

How can I apply this one to my OCX control? This should be simple but you have to know :blush:

Thanks in advance!
 

sunilnair

Member
I dont think it can be done if it is not coming up in the list.

Because the OCX is a separate object within the window..... I dont think even something like the following will do the trick ....

ON RIGHT-MOUSE-CLICK ANYWHERE
DO:
MESSAGE 'here'.
END.

saying that , I will be really interested to know if someone has done this.

-Sunil
 

RKR

Member
Hi Serge,

For this you will need 2 OCX events. The first is the OCX.MouseDown. This event has 4 parameters. The first parameter is p-Button. When the value of p-button = 1 then it means that the left mousebutton has been pressed. If the value is 2 then the right button is pressed. Save this value in a variable that you have defined at the top level of your procedure you will need it later :awink:

The next event that fires when you use your mouse is the OCX.MouseClick event. Since this event fires when a mouse-click is completed, it will always fire after the OCX.MouseDown. In the OCX.MouseClick event you can therefore check your variable that was filled during the mousedown and you will be able to determine if the user pressed the left or the right mouse button.

Greetings,
Ruud
 

Serge

New Member
Like I already said - "Simple, but you just need to know how" :awink:

Thanks a lot Ruud!!

Cheers
 
Top