Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox not showing value that was programatically adde
Message
 
À
21/11/1997 18:40:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00061692
Message ID:
00062505
Vues:
29
>>I have a combobox that is defined as a "drop down list" in a grid.
>>
>>If a value has been programatically changed to something that is not in the list (populated using a select statement), the value will not show whenever the combobox has focus.
>>
>>Further Info:
>>
>>The value show if it doesn't have focus.
>>The value shows if the value is part of the list of values in the combobox.
>>At any time later if the combox receives focus again, this value will not be displayed.
>>Using VFP 3.0 Win.
>>Using a view in the grid.
>>Ate thai salad for lunch.
>Hi Evan.
>
>You say that you are programatically changing the Display Value of the combo to one that is not in the list. Does that mean that you are adding this new value to the list? If not, that is what you have to do. Use code similar to the following in the Valid Event to determine if a new value was added to the list:
>
>IF This.DisplayValue == This.Value
>* Do nothing
>ELSE
> REPLACE WITH This.DisplayValue
> This.Requery()
>ENDIF
>
>Does that help?

Not quite. Ohh... to answer your question, I am not adding the value to the list, but changing the value of the bound control source. Once the focus has shifted to another control, the value is displayed but if the focus shifts back to the control, the value does not display. The grid is set to sparse.

I would then have to put this code in the "gotfocus" event, but there must be a better way.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform