Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox InputMask
Message
 
 
À
29/03/2007 16:17:44
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01209790
Message ID:
01210076
Vues:
17
>
>Actually, no matter what you put into a combo, internally it gets stored as a character. The default conversion is probably padding your numbers with too many spaces, so you may want to set your rowsource to none, and in the init of the combo have a
>
>
for i=1 to alen(this.srcArray)
>   this.add(transform(this.srcArray[i], "999")
>endfor
>
>You'd also need to do some manual binding here, since your controlsource is probably numeric, and your row values are now forced into strings (i.e. given up the automatic conversion, so Fox doesn't know it needs to convert back into numbers), like this:
>
>
this.value=val(this.list(this.listindex))
>
>Or you may go straight into the controlsource. This is just off the top of my head, don't even know right now whether this manual binding would go into .valid(), .lostfocus() or .interactivechange().
>
>An easier thing would be if you didn't use an array as the rowsource, but a cursor with just a single n(3) field, with hundred records in it. Then the combo may convert it into c(3) strings, not in default width.

I actually did try, in my first draft, to use a cursor instead of array but ran into a couple of problems. So I decided to switch to an array, which works, so far well.

Thank you for your suggestion. If I have time, I may try your approach. However, since this morning (when I work on this combobox), I have learned to live with a bit wider combo box than I would like.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform