Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine Position of Control in focus
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00545297
Message ID:
00545530
Views:
10
Thanks George for the tip on OBJTOCLIENT(). I have experimented with it and came up with the following code in the GotFocusEvent of the TextBox.

The code could be made more generic by walking the chain of Parent BaseClasses to get the path to the object. In this (test) case the textbox is contained in a container along with a label which is then placed on the form.

Thanks again



LOCAL lnLeft, lnTop

lcObj = 'This.Parent.Parent' && FORM

loObj = EVAL(lcObj)

* Get the left of the form, then the parent container left, then the control
* itself. I added the This.Width to position mouse pointer a end of textbox
* for no particular reason.

lnLeft = OBJTOCLIENT(loObj, 2) + This.Parent.Left + This.Left + This.Width
lnTop = OBJTOCLIENT(loObj, 1) + This.Parent.Top + This.Top

MOUSE AT lnTop, lnLeft PIXELS
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform