Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trouble getting PrintDialog to display
Message
From
23/02/2005 18:40:20
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
Trouble getting PrintDialog to display
Environment versions
Environment:
C# 1.1
OS:
Windows 2000 SP4
Miscellaneous
Thread ID:
00989893
Message ID:
00989893
Views:
49
I have having trouble with a PrintDialog which sometimes doesn't display.

My app is a long business report that chugs away and then automatically displays the PrintDialog to print the report. If I switch applications while the debug process in running in VS.NET, sometimes I come back after the report has finished, pause the debugger, and it is paused at the dlgPrint.ShowDialog() line, but the dialog is not displaying.

I rewrote the code so that the process that runs the code below is in a separate thread from the main UI, but that didn't help. Unfortunately, the problem is intermittent. If I never switch to another app, I don't have the problem, but I don't want to require my users to be hostage to the program.
PrintDialog dlgPrint = new PrintDialog();

// PrintDocument docPrint is initialized and set
dlgPrint.Document = docPrint;

dlgPrint.ShowDialog();
Application.DoEvents(); // An attempt to get the dialog displayed

if (dlgPrint.ShowDialog() == DialogResult.OK)
   ...
I was under the impression that print dialogs are modal system windows, (they would pop on top of any other apps). Does anyone have any idea what might be causing this problem?
David S. Alexander
Kettley Publishing
20271 SW Birch Street, 2nd Floor
Newport Beach, CA 92660-1752
Reply
Map
View

Click here to load this message in the networking platform