Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo field reverts to old value when focus returns to i
Message
From
06/08/1999 11:22:03
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00249541
Message ID:
00250693
Views:
22
>The purpose for style dorpdowncombo is to allow the user to type ing a value that isn't in the list and then to save that value. if you want to limit the user to nly those items in teh list, that is what the dropdownlist is for.
>


Yeah. I finally gave up on the combo and went to the dropdownlist. Previously I had had trouble getting the latter's incremental search to work consistently. Increasing the value of _dblclick to one second while the list has the focus seemed to help. I find incremental search to be a little confusing when entering numeric values all of which have the same first couple of digits (which happens to be the special case I'm dealing with). Would rather use method where user types whole value, then registers it with the ENTER or TAB...and unless I've missed something, a dropdownlist can't do that.

Thanks for the help. Highly valuable, as usual. Also, as usual, your explanation leads me to more questions. In the following code snippet I'm curious as to how the NOT of the 1st case you test for could ever occur...namely displayvalue = value but what they typed IS NOT in the list.

>As for restoring the combo; you would need to use a combo class to which you have added a property named OldValue. In the gotfocus you;
>
>This.OldValue = This.Value
>
>In the valid you would;
>
>
>IF This.DisplayValue == This.Value && They typed something that is in the list
>   RETURN
>ENDIF
>IF This.DisplayValue is Invalid
>   This.Value = This.OldValue
>   RETURN 0 && Keeps focus in the combo
>ENDIF
>* Here you need to handle the new value that was typed and is not in the list
>* you may add the value to the rowsource for the combo and then requery the
>* combo.
>
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform