Information générale
Titre:
MROW() or similar - relative position
Is there any simple (fast) way to get the current mouse position relative to the conatiner (not form) the mouse is in?
e.g. - mouse clicks on a container and holds...if mouse moves outside the container - I need to do something. I have a timer, and each loop thru it checks the MCOL() and MROW() values against THIS.LEFT etc. BUT if this class is inside another container (which it is) THIS.Left = 0 (or small number).
What I need is a mechanism of finding out the position of the mouse in a container, or finding the absolute LEFT, TOP of a container.
Right now I am using:
LOCAL o
o = THIS.Parent
lnX = MCOL(THISFORM.Name, 3)
lnY = MROW(THISFORM.name, 3)
DO WHILE (o.baseclass <> "Form")
lnX = lnX - o.LEFT
lnY = lnY - o.TOP
o = o.Parent
ENDDO
Problem is - some classes (namely a "page") do not have LEFT or TOP properties. and this loop is slow in a 30 ms timer loop...
Using VFP 5, btw..
Thanks in advance
Tim
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement