This documentation is archived and is not being maintained.

PrintDocument.QueryPageSettings Event

Occurs immediately before each PrintPage event.

[Visual Basic]
Public Event QueryPageSettings As QueryPageSettingsEventHandler
[C#]
public event QueryPageSettingsEventHandler QueryPageSettings;
[C++]
public: __event QueryPageSettingsEventHandler* QueryPageSettings;

[JScript] In JScript, you can handle the events defined by a class, but you cannot define your own.

Event Data

The event handler receives an argument of type QueryPageSettingsEventArgs containing data related to this event. The following QueryPageSettingsEventArgs properties provide information specific to this event.

Property Description
Cancel (inherited from CancelEventArgs) Gets or sets a value indicating whether the event should be canceled.
PageSettings Gets or sets the page settings for the page to be printed.

Remarks

It is possible to print each page of a document using different page settings. You set page settings by modifying individual properties of the QueryPageSettingsEventArgs.PageSettings property or by setting the property to a PageSettings. Changes made to the PageSettings affect only the current page, not the document's default page settings. The print job can also be canceled by setting the Cancel property to true for the QueryPageSettingsEventArgs.

To associate the event with your event handler, add an instance of the QueryPageSettingsEventHandler delegate to the event. The event handler is called whenever the event occurs. For more information about handling events with delegates, see Events and Delegates.

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 | QueryPageSettingsEventHandler | PrintPageEventArgs | BeginPrint | EndPrint | PrintPage

Show: