Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Initial Value of ComboBox
Message
De
02/10/1996 18:08:22
Grant Floyd
Phil Radford Consultants
Tauranga, Nouvelle Zélande
 
 
À
01/10/1996 14:53:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00008569
Message ID:
00009187
Vues:
25
>>The behavior that I want, and can't seem to get, is for the combobox to >>have the first item selected and showing in the combobox rather than an >>empty combobox. If I don't append blank the combo shows the top item >>of the parent table. But, I *think* I'm only appending a blank to the >>child table. Why does the combobox get a blank to start off with?

>>If I can't get that behavior, I'd like to at least have my valid code >>which checks for EMPTY() fire when they tab out of the combobox without >>selecting a value. But, I guess with combos, just tabbing through >>doesn't cause the valid to fire?

It did on the example I tested.

>From Lar:
>To make the combo box start with the first item (or any item)
>in the init of the combo box type:
>this.listindex = 1 (or 2 for the second item, etc ...)
>LAr.

Unfortunately, if you append blank and your combobox has a control source of customer.type, and it is populated with something simple like Value type - OLD, NEW, this doesn't work. The Control Source ie the field value overwrit the value/display value. I got around that by removing the Control Source and placing "REPLACE customer.type WITH THIS.Value" in the Combo.Valid event. I think that could cause problems when you exit the form, without checking the combo...

Any better way, using Control Source?
----------------------
Grant Floyd
Phil Radford Consultants
email:floydg@radcomp.co.nz
phone (07) 5784576
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform