Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trouble getting PrintDialog to display
Message
De
23/02/2005 18:40:20
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
Trouble getting PrintDialog to display
Versions des environnements
Environment:
C# 1.1
OS:
Windows 2000 SP4
Divers
Thread ID:
00989893
Message ID:
00989893
Vues:
47
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
Répondre
Fil
Voir

Click here to load this message in the networking platform