PrintDialog Class

 

Invokes a standard Microsoft Windows print dialog box that configures a PrintTicket and PrintQueue according to user input and then prints a document.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

System.Object
  System.Windows.Controls.PrintDialog

type PrintDialog = class end

NameDescription
System_CAPS_pubmethodPrintDialog()

Initializes a new instance of the PrintDialog class.

NameDescription
System_CAPS_pubpropertyCurrentPageEnabled

Gets or sets a value that indicates whether the option to print the current page is enabled.

System_CAPS_pubpropertyMaxPage

Gets or sets the highest page number that is allowed in page ranges.

System_CAPS_pubpropertyMinPage

Gets or sets the lowest page number that is allowed in page ranges.

System_CAPS_pubpropertyPageRange

Gets or sets the range of pages to print when PageRangeSelection is set to UserPages.

System_CAPS_pubpropertyPageRangeSelection

Gets or sets the PageRangeSelection for this instance of PrintDialog.

System_CAPS_pubpropertyPrintableAreaHeight

Gets the height of the printable area of the page.

System_CAPS_pubpropertyPrintableAreaWidth

Gets the width of the printable area of the page.

System_CAPS_pubpropertyPrintQueue

Gets or sets a PrintQueue that represents the printer that is selected.

System_CAPS_pubpropertyPrintTicket

Gets or sets the PrintTicket that is used by the PrintDialog when the user clicks Print for the current print job.

System_CAPS_pubpropertySelectedPagesEnabled

Gets or sets a value that indicates whether the option to print the selected pages is enabled.

System_CAPS_pubpropertyUserPageRangeEnabled

Gets or sets a value that indicates whether users of the Print dialog box have the option to specify ranges of pages to print.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodPrintDocument(DocumentPaginator, String)

Prints a DocumentPaginator object to the PrintQueue that is currently selected.

System_CAPS_pubmethodPrintVisual(Visual, String)

Prints a visual (non-text) object, which is derived from the Visual class, to the PrintQueue that is currently selected.

System_CAPS_pubmethodShowDialog()

Invokes the PrintDialog as a modal dialog box.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

A user can use the Print dialog box to select a printer, configure it, and perform a print job.

Strictly speaking, you can use the PrintDocument method without ever opening the dialog. In that sense, the control can be used as an unseen printing component. But for performance reasons, it would be better to use either the AddJob method or one of the many Write and WriteAsync methods of the XpsDocumentWriter. For more about this, see How to: Programmatically Print XPS Files.

Do not confuse this class, System.Windows.Controls.PrintDialog, with System.Windows.Forms.PrintDialog. The latter is used with Windows Forms applications. System.Windows.Controls.PrintDialog is used with Windows Presentation Foundation (WPF) applications. 

The following example shows how to create an instance of and display a simple PrintDialog by using Extensible Application Markup Language (XAML) markup and code.

<Button Width="200" Click="InvokePrint">Invoke PrintDialog</Button>

...

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: