Search:

Custom Search
_________________________________________________________________

Wednesday, January 16, 2008

Print in c#

This is a c# code that opens the Windows Print Dialog and lets you choose the printer you want from the list.


PrintDialog dia = new PrintDialog();

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

if (dia.ShowDialog() == DialogResult.OK)

{

printDoc.PrinterSettings.PrinterName = dia.PrinterSettings.PrinterName;

printDoc.Print();

}

No comments: