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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box displaying year value aligned to right

Status
Not open for further replies.

Pollock

Programmer
Jun 2, 2000
49
CA
Ok, this one is a puzzle. I create a cursor of distinct years from a table. I make the combo box rowsource the cursor field and the rowsourcetype is alias. When the form comes up the year is aligned to the right so only the first two numbers show. I need it aligned to left so full year shows.
 
Does your combo box control have an alignment property?

This old world keeps spinning round - It's a wonder tall trees ain't layin' down
 
The alignment is set to left, but problem seems to be that foxpro is converting the numeric to string when it puts it in the list and the string is being padded with spaces. These spaces are forcing the number to be partially hidden
 
strange I dont see that...

The Year(date()) is alligned to the left... is century set to on and what is the combo width (not column width) set as?
 
Use alltrim
ALLTRIM(STR(YEAR(DATE())))

If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
Combos and lists can only contain character data. When you give them something else, they convert it internally.
 

...foxpro is converting the numeric to string when it puts it in the list and the string is being padded with spaces.

So convert it yourself, and be sure to specify number of symbols you need, so there won't be any padding:
STR(YEAR(DATE()),4)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top