Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo field reverts to old value when focus returns to i
Message
 
À
05/08/1999 18:56:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00249541
Message ID:
00250515
Vues:
27
>The valid is the natural place to detect an invalid entry, but if an invalid entry is detected, what is the proper way to restore the combo to its state just prior to the user's entering a bad value?

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.

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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform