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);
|