Export (0) Print
Expand All

PrintDocument.OnPrintPage Method

Raises the PrintPage event. It is called before a page prints.

[Visual Basic]
Protected Overridable Sub OnPrintPage( _
   ByVal e As PrintPageEventArgs _
)
[C#]
protected virtual void OnPrintPage(
 PrintPageEventArgs e
);
[C++]
protected: virtual void OnPrintPage(
 PrintPageEventArgs* e
);
[JScript]
protected function OnPrintPage(
   e : PrintPageEventArgs
);

Parameters

e
A PrintPageEventArgs that contains the event data.

Remarks

The OnPrintPage method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

When a derived class calls the OnPrintPage method, it raises the PrintPage event by invoking the event handler through a delegate. For more information, see Raising an Event.

Notes to Inheritors:  When overriding OnPrintPage in a derived class, be sure to call the base class's OnPrintPage method so that registered delegates receive the event.

Requirements

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

PrintDocument Class | PrintDocument Members | System.Drawing.Printing Namespace | PrintPage | PrintPageEventArgs

Show:
© 2015 Microsoft