Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine Position of Control in focus
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00545297
Message ID:
00545530
Vues:
21
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform