Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox problem
Message
 
 
À
12/12/2005 14:34:11
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01077137
Message ID:
01077269
Vues:
38
Dragan,

So far I don't see problems with the solution I implemented. I definitely don't want to go timer's road.

>>Hi everybody,
>>
>>I have the following code in my combobox valid method:
>>
>>local lcPK
>>lcPK = this.value
>[snip]
>>endwith
>>
>>The problem is, that once I selected the value and want to select another and try to quickly type some letters, it fires the message right away for only the first letter I typed. What should I change to make it react on all the letters I quickly type and don't get me message until I really selected the value?
>
>The only solution I can see here is to have a timer which would have _dblclick+1 for .interval, would be started in combo's .GotFocus() and be reset for each keypress() and interactivechange() of the first combo, and would set some property once it gets the chance to fire its .timer() event. Then in the combo's valid, if this property is set, validate, if not, just return 1. In combo.lostFocus(), disable the timer.
>
>In this scenario, when your combo gets focus, the timer starts ticking, but each time you change the value of the combo, the timer starts ticking from zero. So as long as you keep typing, it doesn't validate (or doesn't go through validation - it jumps out). Once you make a _dblclick sized break, the timer eventually fires, sets that property, calls the validation, stops. In .lostFocus you should just stop the timer.
>
>There are problems here with this solution as well. If you've clicked out of the combo, then what - there's no interactive change, and you may still have done this before the _dblclick seconds have expired, so it wouldn't validate.
>
>Another thing that comes to my mind - what's the length of your key to the other combo? Maybe you can just skip validation if insufficient length was entered.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform