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

How can I count pixels so that columns line up? 1

Status
Not open for further replies.

EDsedlar

Programmer
Jun 7, 2000
4
0
0
US
If I use a combo or a list box and have a concatinated field with text columns and add spaces so all the fields are the same length I get a twisted sister look in my drop down list.<br><br>Is there any way to get thse to line up?<br><br>DDDDDDDDDD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10 capital D's then 5 spaces<br>iiiiiiiiii&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10 i's then 5 spaces<br><br>I know you can do this with a proportional font but there a only a few and they don't look good.
 
Hi Edsedlar,<br>&nbsp;The simplest solution, as you eluded to, is to use a fixed length font. This is the method I choose to use. Check out Courier New font. It doesnt look as old fashioned as most of its counterparts do. In fact, it is the default VFP text editor font, I believe.<br>&nbsp;Your second option is to use columns. Since you are using concatenated fields, Im not so sure this is feasible in your case.<br>&nbsp;Last, and definitely the one with the most overhead. Take a look at the TxtWidth() function. You can use it in conjunction with the FontMetric() function to perform the computations you will need.<br><br>Jon
 
If the columns are concatenated <b>within</b> the combo box (IOW, not in some SELECT statement), you can use the combo box's ColumnWidths property to specify hard widths for each of the columns making up your combo box. <p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top