windowsforms-devexpress-dot-xtraprintinglinks-24e967c4.md
A link to print the RichTextBox control.
Namespace : DevExpress.XtraPrintingLinks
Assembly : DevExpress.XtraPrinting.v25.2.dll
NuGet Package : DevExpress.Win.Printing
public class RichTextBoxLink :
RichTextBoxLinkBase,
IWinLink
Public Class RichTextBoxLink
Inherits RichTextBoxLinkBase
Implements IWinLink
Use the RichTextBoxLink class to print the RichTextBox control.
To do this, assign an existing RichTextBox object to the RichTextBoxLinkBase.RichTextBox property, and then call either the RichTextBoxLink.ShowPreview (RichTextBoxLink.ShowPreviewDialog) method to preview a document, or the RichTextBoxLink.Print (RichTextBoxLink.PrintDlg) method to send it to a printer.
This example illustrates how to create and display a Print Preview for the RichTextBox control, via the RichTextBoxLink.
using System;
using System.Windows.Forms;
using DevExpress.XtraPrintingLinks;
// ...
private void simpleButton1_Click(object sender, EventArgs e) {
RichTextBoxLink rtbLink = new RichTextBoxLink();
rtbLink.RichTextBox = richTextBox1;
rtbLink.RtfReportHeader = "Rich Text Box Link";
printingSystem1.Links.Add(rtbLink);
rtbLink.ShowPreviewDialog();
}
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraPrintingLinks
' ...
Private Sub simpleButton1_Click(ByVal sender As Object, _
ByVal e As EventArgs) Handles simpleButton1.Click
Dim rtbLink As RichTextBoxLink = New RichTextBoxLink()
rtbLink.RichTextBox = richTextBox1
rtbLink.RtfReportHeader = "Rich Text Box Link"
printingSystem1.Links.Add(rtbLink)
rtbLink.ShowPreviewDialog()
End Sub
Object MarshalByRefObject Component LinkBase RichTextBoxLinkBase RichTextBoxLink
See Also