windowsforms-devexpress-dot-xtrarichedit-dot-richeditcontrol-3e3a737c.md
Invokes the Print Preview window.
Namespace : DevExpress.XtraRichEdit
Assembly : DevExpress.XtraRichEdit.v25.2.dll
NuGet Package : DevExpress.Win.RichEdit
public void ShowPrintPreview()
Public Sub ShowPrintPreview
The Print Preview form utilizes the Ribbon user interface by default. To select the Bars user interface, use the PrintingOptions.PrintPreviewFormKind property.
Note
This method invokes the Document Viewer, so you have to deploy additional assemblies required for this dialog. See the Redistribution and Deployment topic for more information.
The following code checks the RichEditControl.IsPrintingAvailable property value and invokes the print preview window. The current RichEditControl instance is passed to the BarItem.ItemClick event handler using the BarItem.Tag property.
static void buttonCustomAction_ItemClick_ShowPrintPreviewMethod(object sender, ItemClickEventArgs e) {
RichEditControl richEdit = e.Item.Tag as RichEditControl;
if(richEdit.IsPrintingAvailable) {
richEdit.ShowPrintPreview();
}
}
Private Shared Sub buttonCustomAction_ItemClick_ShowPrintPreviewMethod(ByVal sender As Object, ByVal e As ItemClickEventArgs)
Dim richEdit As RichEditControl = TryCast(e.Item.Tag, RichEditControl)
If richEdit.IsPrintingAvailable Then
richEdit.ShowPrintPreview()
End If
End Sub
The following code snippets (auto-collected from DevExpress Examples) contain references to the ShowPrintPreview() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-richedit-layout-api/CS/Form1.cs#L179
{
richEditControl1.ShowPrintPreview();
}
winforms-richeditcontrol-common-api/CS/RichEditAPISample/CodeExamples/RichEditControlActions.cs#L66
if(richEdit.IsPrintingAvailable) {
richEdit.ShowPrintPreview();
}
winforms-richedit-layout-api/VB/Form1.vb#L148
Private Sub simpleButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles simpleButton2.Click
richEditControl1.ShowPrintPreview()
End Sub
winforms-richeditcontrol-common-api/VB/RichEditAPISample/CodeExamples/RichEditControlActions.vb#L71
If richEdit.IsPrintingAvailable Then
richEdit.ShowPrintPreview()
End If
See Also