DrawString with PrintDocument

  • Thread starter Thread starter Bruno Piovan
  • Start date Start date
B

Bruno Piovan

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
 
Bruno Piovan said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top