On 64 bit Vista systems, the print dialog box will not display (and thus, no pages will print) unless the following
Code: Select all
PrintDialog1.UseEXDialog = true; //needed because PrintDialog was not showing on 64 bit Vista systems
Code: Select all
public void StartPrint(Stream streamToPrint, string streamType){
this.printDocument3.PrintPage += new PrintPageEventHandler(printDocument3_PrintPage);
this.streamToPrint = streamToPrint;
this.streamType = streamType;
System.Windows.Forms.PrintDialog PrintDialog1 = new PrintDialog();
PrintDialog1.AllowSomePages = true;
PrintDialog1.ShowHelp = true;
PrintDialog1.Document = printDocument3;
PrintDialog1.UseEXDialog = true; //needed because PrintDialog was not showing on 64 bit Vista systems
if (PrintDialog1.ShowDialog() == DialogResult.OK)
{
this.printDocument3.Print();
}
}