Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Working out relative xy coords within a control
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01340698
Message ID:
01341072
Views:
13
That's great, thanks Sergey!

>
>* MouseDown
>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>
>* Top and Left of the button relative to the form
>* If button is placed directly on the form, this step is not necessary
>lnTop  = OBJTOCLIENT(This, 1)
>lnLeft = OBJTOCLIENT(This, 2)
>
>* X and Y coordinates of the mouse relative to the button
>lnX = nXCoord - lnLeft + 1
>lnY = nYCoord - lnTop + 1
>* ...
>
>
>>
>>I have a command button with a little picture imgae (a tick) when action has been taken, otherwise it's displayed without the image.
>>
>>I know I could re-design the whole control to be in a container, but I was hoping I could detect when the mousedown event (part of the click) was over the little image rather than over the caption part of the button.
>>
>>I have so far been messing about with objtoclient(), the x and y coords in the mousedown without much success.
>>
Mathias Banda

Time is longer than a rope.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform