I was wondering, is there any way to right aline nembers in a listbox control when using a proportional font like Arial. I have tried formating it at the rowsorce but this still doesn't help
Ok what I mean is:
I have a listbox that I want to display both charcter and numeric data.
I am use in a readonly cursor as the rowsource and rowsource type set to 2 - alias.
I want to use a proptional font like arial but it seems that vfp convets the numeric data to text and then left alines the column in the list box.
What I want to know is the any way that I can have to numeric data right alined
You definitely CAN do that, but it will take much of time. Do you really need this with non-proportional font? set it to proportional and your problem will went away. Otherwise, you will require to find a character in the font that have the same width as a digit in a number, or 2 such characters have such width. Than using List[RowNumber, 2] replace all spaces with that character(s) so digits will look like aligned. This also could not be done with all fonts, if could be done at all. Do replacing of spaces after each requery, in the requery event:
ListBox::Requery
for i = 1 to this.ListCount
this.List[i,2] = strtran(this.List[i,2],' ',chr(MyCharacterCode))
endfor
nodefault
That special character, of course, should be as empty as possible ;-)
I did not do that way, I used proportional font always.
U have to use a monospaced font like Arial and "fedd" the listbox with a SQL statement such as d
sele 00000000+nField from myTable into cursor myCrs.
More info's can get from Grigore Dolghin gdolghin@yahoo.com
ps: u can also try to set rowsource to SQL statement.
Hope this helps ...
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.