2 // Test application for the PrinttDialogTest class implementation
5 // Jordi Mas i Hernàndez, jmas@softcatala.org
9 using System
.Collections
;
10 using System
.Windows
.Forms
;
12 using System
.Drawing
.Printing
;
15 class PrintDialogTest
: Form
{
17 public PrintDialogTest(): base() {
21 public static void Main(string[] args
){
23 PrintDialog printDlg
= new PrintDialog();
25 Console
.WriteLine ("Default class values------");
26 Console
.WriteLine ("AllowPrintToFile->" + printDlg
.AllowPrintToFile
);
27 Console
.WriteLine ("AllowSelection->" + printDlg
.AllowSelection
);
28 Console
.WriteLine ("AllowSomePages->" + printDlg
.AllowSomePages
);
29 Console
.WriteLine ("ShowHelp->" + printDlg
.ShowHelp
);
30 Console
.WriteLine ("ShowNetwork->" + printDlg
.ShowNetwork
);
31 Console
.WriteLine ("PrintToFile->" + printDlg
.PrintToFile
);
33 // Declare the PrintDocument object.
34 PrintDocument docToPrint
= new PrintDocument();
36 printDlg
.Document
= docToPrint
;
37 DialogResult result
= printDlg
.ShowDialog();
39 // If the result is OK then print the document.
40 if (result
==DialogResult
.OK
){
42 Console
.WriteLine ("Copies->" + printDlg
.PrinterSettings
.Copies
);