How to build a print line

I have a listview that I want to print... to do this with the print engine I have, I need to build the print line and pass it to the print engine.  My problem is that when building the line, each element in the listview is of a different length.  I was wondering how to make each element line up vertically, ie each element under the previous one.  Any ideas?
rmmarshAsked:
Who is Participating?
 
WinterMuteUKConnect With a Mentor Commented:
I guess this is where tabs come into play, putting the '\t' should give you a fixed space, but you've got to work out how many tabs are needed per word which is where it gets tricky.
0
 
WinterMuteUKCommented:
Hi rmmarsh,

Do you know the length of the 'maximum' size of each column?
(You could get this by going through each item), if so, you can pad each column entry:
   listView1.Item.Text.PadRight(maximumSize), etc...

Wint.
0
 
rmmarshAuthor Commented:
I tried the padding routine... it doesn't line up because the size of a space is different from the size of a letter (ie the letter 'W')...
0
 
rmmarshAuthor Commented:
I also just tried changing the fonts to fixed-width... still prints the same old font, no matter what I change it to... any ideas anyone?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.