PrintDialogTest.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // Test application for the PrinttDialogTest class implementation
  3. //
  4. // Author:
  5. // Jordi Mas i Hernàndez, [email protected]
  6. //
  7. using System;
  8. using System.Collections;
  9. using System.Windows.Forms;
  10. using System.Drawing;
  11. using System.Drawing.Printing;
  12. class PrintDialogTest : Form {
  13. public PrintDialogTest(): base() {
  14. }
  15. public static void Main(string[] args){
  16. PrintDialog printDlg = new PrintDialog();
  17. Console.WriteLine ("Default class values------");
  18. Console.WriteLine ("AllowPrintToFile->" + printDlg.AllowPrintToFile);
  19. Console.WriteLine ("AllowSelection->" + printDlg.AllowSelection);
  20. Console.WriteLine ("AllowSomePages->" + printDlg.AllowSomePages);
  21. Console.WriteLine ("ShowHelp->" + printDlg.ShowHelp);
  22. Console.WriteLine ("ShowNetwork->" + printDlg.ShowNetwork);
  23. Console.WriteLine ("PrintToFile->" + printDlg.PrintToFile);
  24. // Declare the PrintDocument object.
  25. PrintDocument docToPrint = new PrintDocument();
  26. printDlg.Document = docToPrint;
  27. DialogResult result = printDlg.ShowDialog();
  28. // If the result is OK then print the document.
  29. if (result==DialogResult.OK){
  30. //docToPrint.Print();
  31. Console.WriteLine ("Copies->" + printDlg.PrinterSettings.Copies);
  32. }
  33. }
  34. }