This documentation is archived and is not being maintained.

PrintController.OnStartPrint Method

When overridden in a derived class, begins the control sequence that determines when and how to print a document.

[Visual Basic]
Public Overridable Sub OnStartPrint( _
   ByVal document As PrintDocument, _
   ByVal e As PrintEventArgs _
public virtual void OnStartPrint(
 PrintDocument document,
 PrintEventArgs e
public: virtual void OnStartPrint(
 PrintDocument* document,
 PrintEventArgs* e
public function OnStartPrint(
   document : PrintDocument,
 e : PrintEventArgs


A PrintDocument that represents the document currently being printed.
A PrintEventArgs that contains the event data.


OnStartPrint is called immediately after the PrintDocument raises the BeginPrint event.

Use the OnStartPrint method to determine when and how to print a document. For example, you can delay printing for 30 minutes or adjust the printer settings for the document. OnStartPrint creates the Graphics object that is sent to the printer. After OnStartPrint is called, the OnStartPage method sets the Graphics object to one of a single page. The OnEndPage method clears the Graphics object, while the OnEndPrint method deallocates the object.

The OnStartPrint method is a good place to verify that PrinterSettings are valid.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

PrintController Class | PrintController Members | System.Drawing.Printing Namespace | OnEndPage | OnEndPrint | OnStartPage | PrinterSettings | PrintEventArgs