Hello,
I don't think Tab characters will be printed as fixed-width spaces. You will
have to handle them manually (manually move the print position). Example:
In the PrintPageEventHandler:
Font f; // Font to be used
float x, y; // Print positions
StringFormat sf = new StringFormat();
string textToPrint = "Sample Text";
....
PrintPageEventArgs.Graphics.DrawString (textToPrint, f, Brushes.Orange, x,
y, sf);
// ASCII 9 is Tab
x += PrintPageEventArgs.Graphics.MeasureString (Convert.ToString((char)9) +
textToPrint, f).Width;
// Prints after a 'tab'
PrintPageEventArgs.Graphics.DrawString (textToPrint, f, Brushes.Orange, x,
y, sf);
Hope this helps?
"E. W via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in message
news:51***********@DotNetMonster.com...
Hi,
I have to print Datagrids (result of DB-Queries) as well formed as seen on
the screen.
So I use tab-signs to seperate the columns and create a file. But the tabs
are not printed (only a space) when I print this file (via PrintDocument.
Print()). What's wrong?
thanks
ew
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200507/1