Back to Devexpress

RichTextBoxLink Class

windowsforms-devexpress-dot-xtraprintinglinks-24e967c4.md

latest3.6 KB
Original Source

RichTextBoxLink Class

A link to print the RichTextBox control.

Namespace : DevExpress.XtraPrintingLinks

Assembly : DevExpress.XtraPrinting.v25.2.dll

NuGet Package : DevExpress.Win.Printing

Declaration

csharp
public class RichTextBoxLink :
    RichTextBoxLinkBase,
    IWinLink
vb
Public Class RichTextBoxLink
    Inherits RichTextBoxLinkBase
    Implements IWinLink

Remarks

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.

Example

This example illustrates how to create and display a Print Preview for the RichTextBox control, via the RichTextBoxLink.

csharp
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();
}
vb
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

Inheritance

Object MarshalByRefObject Component LinkBase RichTextBoxLinkBase RichTextBoxLink

See Also

RichTextBoxLink Members

Printing Links

DevExpress.XtraPrintingLinks Namespace