Skip to Content
.NET Windows Forms in a Nutshell
book

.NET Windows Forms in a Nutshell

by Ian Griffiths, Matthew Adams
March 2003
Intermediate to advanced
896 pages
32h 35m
English
O'Reilly Media, Inc.
Content preview from .NET Windows Forms in a Nutshell

Name

PrintControllerWithStatusDialog

Synopsis

This class, derived from System.Drawing.Printing.PrintController, provides a status dialog while printing occurs. The dialog is hosted on a separate thread, and it automatically updates the document title and page number as printing continues.

The implementation of this class is interesting, as it illustrates one way of managing a multithreaded progress dialog. A decompilation tool such as Anakrino allows you to examine this for yourself.


public class PrintControllerWithStatusDialog : System.Drawing.Printing.PrintController {

// Public Constructors

   public PrintControllerWithStatusDialog(System.Drawing.Printing.PrintController underlyingController);

   public PrintControllerWithStatusDialog(System.Drawing.Printing.PrintController underlyingController,

        string dialogTitle);

// Public Instance Methods

   public override void OnEndPage(System.Drawing.Printing.PrintDocument document,

        System.Drawing.Printing.PrintPageEventArgs e);  // overrides System.Drawing.Printing.PrintController

   public override void OnEndPrint(System.Drawing.Printing.PrintDocument document,

        System.Drawing.Printing.PrintEventArgs e);  // overrides System.Drawing.Printing.PrintController

   public override Graphics OnStartPage(System.Drawing.Printing.PrintDocument document, 

        System.Drawing.Printing.PrintPageEventArgs e);  // overrides System.Drawing.Printing.PrintController

   public override void OnStartPrint(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintEventArgs ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows Forms 2.0 Programming

Windows Forms 2.0 Programming

Chris Sells, Michael Weinhardt
Pro C# 7: With .NET and .NET Core

Pro C# 7: With .NET and .NET Core

Andrew Troelsen, Philip Japikse

Publisher Resources

ISBN: 0596003382Supplemental ContentCatalog PageErrata