|
Home > Archive > Getting Started with dBASE > November 2006 > Justify & Combo box
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Justify & Combo box
|
|
| Michel PAIN 2006-10-31, 7:13 pm |
| Hello,
I have hard time to understand how I can control the way data is displayed in the combobox. for example a numeric value (N 5.2) is left justified ??? "5.50 ", "19.50 " I expected " 5.50"," 19.50"
and the width of the box must be set to a value larger than necessary, to allow the entire display.
How to control ?
thanks for help
| |
| Todd Kreuter 2006-10-31, 7:13 pm |
| Michel PAIN wrote:
>
> Hello,
> I have hard time to understand how I can control the way data is displayed in the combobox. for example a numeric value (N 5.2) is left justified ??? "5.50 ", "19.50 " I expected " 5.50"," 19.50"
> and the width of the box must be set to a value larger than necessary, to allow the entire display.
> How to control ?
A combobox value is type character (string). You can format strings
using the TRANSFORM function. To get combobox strings formatted, you
have to basically build the dataSource yourself by traversing through
the source and transforming the value. For example:
private a
aSource = new array()
for i = 1 to 1001 step 100
aSource.add(TRANSFORM(i, "99,999.99"))
endfor
for i = 1 to aSource.size
? aSource[i]
endfor
To assign this array as the combobox dataSource:
form.combobbox1.dataSource = "Array aSource"
--
Todd Kreuter [dBVIPS]
| |
| Michel PAIN 2006-11-01, 5:12 am |
| Thanks a lot, I didn't realize the character aspect.
I rush to my keyboard
thanks again Michel
Todd Kreuter Wrote:
> Michel PAIN wrote:
>
> A combobox value is type character (string). You can format strings
> using the TRANSFORM function. To get combobox strings formatted, you
> have to basically build the dataSource yourself by traversing through
> the source and transforming the value. For example:
>
> private a
> aSource = new array()
> for i = 1 to 1001 step 100
> aSource.add(TRANSFORM(i, "99,999.99"))
> endfor
>
> for i = 1 to aSource.size
> ? aSource[i]
> endfor
>
> To assign this array as the combobox dataSource:
>
> form.combobbox1.dataSource = "Array aSource"
>
>
>
> --
> Todd Kreuter [dBVIPS]
|
|
|
|
|