|
-
Apr 16th, 2002, 01:02 PM
#1
Thread Starter
Junior Member
Formatting output in textbox
I'm having problems formatting my programs output in a textbox,( and a .txt file).
My output has to look like this :
number x-coord y-coord z-coord
------------------------------------------------------------
8 5145.658 8521.264 11.154
9 5245.658 8521.264 9.154
10 5345.658 8531.264 10.251
I want this text to be nicely in a column, and 'right-justified'.
Can anyone help me with this
Thanx,
John
-
Apr 16th, 2002, 01:09 PM
#2
Thread Starter
Junior Member
This textbox seems not to support spaces properly so I will try with "_" in stead of " ".
My output has to look like this:
number____x-coord_____y-coord______z-coord
------------------------------------------------------------
__8______5145.658____8521.264_____11.154
__9______5245.658____8521.264______9.154
_10______5345.658____8531.264_____10.251
(the _ are spaces)
-
Apr 16th, 2002, 01:48 PM
#3
What not a ListView, and let it do all the work for you?
-
Apr 16th, 2002, 02:05 PM
#4
PowerPoster
If you use a windows program and you want to justify text, you have three ways to go.
1) You can measure the actual physical length of the text and "draw" it based on the measurements.
2) You can use API.
3) The easiest, but least elegent is to use a monospaced font.
The problem you're running into is that fonts are not evenly spaced, so a combination of 4 spaces along with any other letter will not be the same length as 4 spaces with another letter, if that makes sense.
The courier family is monospaced, so if you set your text box font to courier, then you can justify using spaces.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|