Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding data to a bound combo box
Message
De
26/03/2001 08:19:58
 
 
À
25/03/2001 07:03:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00488389
Message ID:
00488523
Vues:
13
>Hi Bill.
>
>>> Then in the combo's LostFocus ( or possibly Valid ) event you cant test on the combo's Value and DisplayValue properties. If they are not the same, a new value was typed in by the user. You can then run code to take whatever action is necessary, e.g. add the new value into the combo's list <<
>
>This strategy only works if the combo's BoundColumn is column 1. A better strategy would be to test for:
>
>
>IF NOT EMPTY( This.DisplayValue ) AND This.ListIndex = 0
>   *** The user typed in a value not in the combo's list
>   *** Take action to add the item to the list
>   *** And don't forget to requery the combo
>   This.Requery()
>ENDIF
>
>
>This will work regardless of which column is the BoundColumn.
>
>Marcia

Good point, thanks. I have just generally operated on the bound column in this scenario in which the other method works ok, but generalized solutions are generally better. :-)

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform