Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alignment in listbox columns
Message
From
07/02/2002 17:49:31
 
 
To
07/02/2002 14:01:04
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00616855
Message ID:
00617067
Views:
25
Yossi,

Use transform() function in select statement to format the number appropriately. Set the font of the listbox to a fixed width font, such as Courier New.
select assetc.ac_primary, assetc.ac_desc, ;
    assetc.ac_estdate, ;
    transform(ROUND(assetc.ac_estpct * 100,2),"999.99%"), ; 
    assetc.ac_primary ;
  from assetc ;
  where !(assetc.ac_primary = 'XX') ;
  and !(assetc.ac_primary = 'ZZ') ;
  and !(assetc.ac_primary = 'V ') ;
  order by ac_desc ;
  into array this.aArray
BTW, I prefer to set rowsourcetype to SQL-statement. Then you would do something like:
thisform.list1.rowsource = [select assetc.ac_primary, assetc.ac_desc, ;
    assetc.ac_estdate, ;
    transform(ROUND(assetc.ac_estpct * 100,2),"999.99%"), ; 
    assetc.ac_primary ;
  from assetc ;
  where !(assetc.ac_primary = 'XX') ;
  and !(assetc.ac_primary = 'ZZ') ;
  and !(assetc.ac_primary = 'V ') ;
  order by ac_desc ;
  into cursor tempCursor]   && make tempCursor be a unique cursor name
HTH,

steve

>>Hi All:
>>
>>I have a listbox whose rowsourcetype is array. The data is read in at the init of the form as follows:
>>
>>select assetc.ac_primary, assetc.ac_desc, ;
>> assetc.ac_estdate, ROUND(assetc.ac_estpct * 100,2), assetc.ac_primary ;
>> from assetc ;
>> where !(assetc.ac_primary = 'XX') ;
>> and !(assetc.ac_primary = 'ZZ') ;
>> and !(assetc.ac_primary = 'V ') ;
>> order by ac_desc ;
>> into array this.aArray
>>
>>The problem is that I can't figure out how to right align the 4th column. Right now the numbers are coming out centered.
>>
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform