Lukas Hosek

Lukas Hosek

  • NA
  • 4
  • 0

Printing, textoxes and another page.

Nov 18 2010 9:46 AM
Hi,
I have a problem with create new printpage.

 
            printDoc.PrintPage += new PrintPageEventHandler(printDoc_PrintPage);
            PrintPreviewDialog dlg = new PrintPreviewDialog();
            dlg.Document = printDoc;
            dlg.ShowDialog();


---
private void printDoc_PrintPage(Object sender, PrintPageEventArgs e)
        {
Font font_z = new Font("Courier New", 12);
            StringFormat format_z = new StringFormat();
            format_z.Alignment = StringAlignment.Near;
            format_z.LineAlignment = StringAlignment.Near;

 e.Graphics.DrawString("BOLD TEXT:  (from TEXTBOX)", new Font(font_z, FontStyle.Bold), Brushes.Black, 50, 50, format_z);

e.Graphics.DrawString("normal text (from TEXTBOX)", font_z, Brushes.Black, 50, 70, format_z);

e.Graphics.DrawString("BOLD TEXT:  (from TEXTBOX)", new Font(font_z, FontStyle.Bold), Brushes.Black, 50, 100, format_z);


Is some better code?
I have more textboxes and positioning of each line is terrible.

AND
how to get another textbox on another page?

Thanks Lukas

Answers (3)