Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need to know if last action was a mouse click
Message
De
11/02/2009 02:41:28
 
 
À
08/02/2009 08:21:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01380061
Message ID:
01380789
Vues:
45
All the time in my apps, I want to do different things depending on whether the user clicked into a control or tabbed into it. I always use MDOWN() at the top of the When to grab the mouse state as soon as possible. If you run a lot of code in the When and/or GotFocus, you increase the chances of getting an incorrect MDOWN() value the longer you wait to grab it.

-mark

==========

>>How can I tell if the last action was a mouse click? LastKey() only seems to work on keyboard strokes. Inkey() has an "M" option, but that is before the click is done, not after. I'm trying to do something in the GotFocus of a container and I need to know if we got there with a mouse click. I thought I could set a property in the container Click event, but GotFocus comes first. Let's just pretend it's an exercise to see if it can be done rather than get into a discussion as to why I'm doing it.
>>
>
>Why are you ... :-)
>
>If (a control inside) the container is getting activated via mouse click, then the mouse key is still pressed in container.GotFocus(), so you can use MDown() to determine your condition.
>
>
>hth
>-Stefan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform