Back to Devexpress

PdfViewerControl.HighlightSelectionColor Property

wpf-devexpress-dot-xpf-dot-pdfviewer-dot-pdfviewercontrol-667536af.md

latest2.5 KB
Original Source

PdfViewerControl.HighlightSelectionColor Property

Gets or sets the background color of the selected text. This is a dependency property.

Namespace : DevExpress.Xpf.PdfViewer

Assembly : DevExpress.Xpf.PdfViewer.v25.2.dll

NuGet Package : DevExpress.Wpf.PdfViewer

Declaration

csharp
public Color HighlightSelectionColor { get; set; }
vb
Public Property HighlightSelectionColor As Color

Property Value

TypeDescription
Color

A Color structure.

|

Remarks

The following example uses a semi-transparent red as the text highlighting color. You can specify the color’s alpha component to change the transparency value:

xaml
<Window
        xmlns:dxpdf="http://schemas.devexpress.com/winfx/2008/xaml/pdf" ...>
    <Grid>
        <dxpdf:PdfViewerControl x:Name="Viewer" HighlightSelectionColor="#5FFF0000"/>
        <!--or-->
        <dxpdf:PdfViewerControl x:Name="Viewer2">
            <dxpdf:PdfViewerControl.HighlightSelectionColor>
                <Color A="50" R="255" G="0" B="0" />
            </dxpdf:PdfViewerControl.HighlightSelectionColor>
        </dxpdf:PdfViewerControl>
    </Grid>
</Window>

In code, you can call the Color.FromArgb method to set the HighlightSelectionColor:

csharp
Viewer.HighlightSelectionColor = System.Windows.Media.Color.FromArgb(50, 255, 0, 0);
vb
Viewer.HighlightSelectionColor = System.Windows.Media.Color.FromArgb(50, 255, 0, 0)

See Also

SelectAll()

Select

PdfViewerControl Class

PdfViewerControl Members

DevExpress.Xpf.PdfViewer Namespace