PC Review


Reply
Thread Tools Rate Thread

DrawString with PrintDocument

 
 
Bruno Piovan
Guest
Posts: n/a
 
      21st Nov 2004
Hi,
I'm making a report using a PrintDocument and I need to have some words in
bold, different color, etc in the same line

I think I need to use DrawString every time I want to change the font
properties, but how do I draw the next word in front of the last word I
drew?? how do I know the next X??

thanks,
Bruno


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      21st Nov 2004
"Bruno Piovan" <type your email address here> schrieb:
> I'm making a report using a PrintDocument and I need to have some words in
> bold, different color, etc in the same line
>
> I think I need to use DrawString every time I want to change the font
> properties, but how do I draw the next word in front of the last word I
> drew?? how do I know the next X??


You can use 'Graphics.MeasureString' (inside the 'PrintPage' event handler
accessible through 'e.Graphics.MeasureString') to measure the string and
then adjust the output position accordingly.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PrintDocument Jimmy Jam Microsoft VB .NET 1 9th Feb 2009 05:00 PM
Where is the hDC of the PrintDocument. Frank Rizzo Microsoft C# .NET 1 27th Aug 2004 10:58 AM
DrawString in PrintDocument Sylvain Provencher Microsoft Dot NET 0 19th Jan 2004 04:17 PM
PrintDocument JMMB Microsoft C# .NET 1 9th Oct 2003 08:34 AM
PrintDocument Bobby C. Jones Microsoft C# .NET 2 25th Jul 2003 06:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:21 AM.