Information générale
Catégorie:
Codage, syntaxe et commandes
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
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