المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Printing Question - characters per line



C# Programming
05-06-2009, 02:50 AM
Hi Guys,

I am trying to print some items from a listview. I read the whole listview item in a String and then i try to see how many characters i can write on a line of the page that i want to print one :

public void pd_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
...
float characterPerLine = e.MarginBounds.Width/printFont.GetHeight(e.Graphics);
...
}
but this is not returning me the correct number.
The question is ... how can i calculate the number of characters per line when printing?

Kind regards,
Alex

“Be the change you want to see in the world.”