Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I was wondering, is there any way t

Status
Not open for further replies.

safraser

Programmer
Apr 12, 2001
76
NZ
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
 
Hi my friend
Can you please try to state you problem in a more clear way.
Thanks Walid Magd
Engwam@Hotmail.com
 
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
 
Hi!

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.

Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
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 ...
 
thanks for the reply but I had already tried that,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top