I am using class-container that contains listbox.Populating listbox with 7 columns. and would like to align some of them to the left and some to the right. can’t find the appropriate property ..what am I blind ?
Brezhnev (Programmer):
Populating listbox with 7 columns. and would like to align some of them to the left and some to the right. can’t find the appropriate property ..what am I blind ?
No, you are not blind: there ain't no such thing as Alignment property in regular VFP ListBox control.
You may want to consider either using Grid control instead, or finding some custom ListBox control that does have this property. (I, personally, would rather go with Grid.)
Note also that ListBox has the limit: no more than 64000 line items. Grid doesn't have this limitation.
I hope this would help.
Regards,
Ilya
P.S. Off the record: any relation to late Leonid Brezhnev?
All you've got to do is to set the ColumnWidths property.
Say the listbox is 300 pixels wide. You might set the Columnwidths to "50,100,20,30,50,25,25" for example. That way, the columns will line up nicely.
As you say, non-proportional font is a solution for using Listbox with alignment. If you insist to use Listbox, I think this could be the only way.
Use Courier New font
Format all list items (right alignment) by using transform or str command. I think you could have what you expected. of course, columnwidths is required.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.