PrintDialog.ShowDialog() immediately returns DialogResult.Cancel

PrintDialog.ShowDialog() immediately returns DialogResult.Cancel

Post by John A Gra » Fri, 03 Apr 2009 05:46:59


System.Windows.Forms.PrintDialog.ShowDialog()

Has anyone encountered an environment where this call immediately returns
DialogResult.Cancel ?

No print dialog is shown , no exception is thrown , no hang .... bizarre.

This doesn't happen on all our machines , just on a couple of Windows Server
2003 RC2 Enterprise x64 Edition boxes.
 
 
 

PrintDialog.ShowDialog() immediately returns DialogResult.Cancel

Post by Jeff Johns » Wed, 15 Apr 2009 06:21:45


Just off the top of my head...any chance that these two servers have
absolutely no printers defined?

 
 
 

PrintDialog.ShowDialog() immediately returns DialogResult.Cancel

Post by V2Vz » Mon, 27 Apr 2009 11:24:01

I ran into this as well. I just set UseEXDialog to true working around it.
Not sure what the root cause was...


PrintDialog printDlg = new PrintDialog();
printDlg.Document = doc;
printDlg.UseEXDialog = true;

DialogResult res = printDlg.ShowDialog();