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

Printed text onto PrintDocument has missing tabs

Status
Not open for further replies.

TheVampire

Programmer
May 1, 2002
828
0
0
US
Using VS 2008 and I'm printing a line of text that has tabs embedded in it. Everything goes fine and I draw it to my Printdocument graphics object, but when I preview the output with the printpreviewdialog all of the tabs are missing from the text. If I debug it right at the point of the line

Code:
e.Graphics.DrawString(MyDocHeader, MyFont, Brushes.Black, HeaderPositionX, HeaderPositionY, MyStringFormat)

and look at the MyDocHeader string data with the 'Text Visualizer' it shows the tabs in the text correctly.

If makes any difference, the font and string format are set up this way:

Code:
Using MyFont As New Font("Times New Roman", 12, FontStyle.Regular, GraphicsUnit.Point)

MyStringFormat.Alignment = StringAlignment.Near

Any ideas on why it's doing this? Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top