Search:

Custom Search
_________________________________________________________________

Wednesday, January 16, 2008

Print Preview in c#

This code is to show the document printDoc on the Print Preview window.

PrintPreviewDialog dlg = new PrintPreviewDialog();

printDoc.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

//Assign printDoc as the document to preview

dlg.Document = printDoc;

dlg.ShowDialog();

No comments: