Back to Devexpress

TextEditCustomHighlightTextEventArgs.HighlightRanges(String, Color, CompareOptions) Method

windowsforms-devexpress-dot-xtraeditors-dot-texteditcustomhighlighttexteventargs-dot-highlightranges-x28-system-dot-string-system-dot-drawing-dot-color-system-dot-globalization-dot-compareoptions-x29.md

latest2.4 KB
Original Source

TextEditCustomHighlightTextEventArgs.HighlightRanges(String, Color, CompareOptions) Method

Highlights all text blocks that have the specified content using a custom foreground color.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public void HighlightRanges(
    string text,
    Color foreColor,
    CompareOptions options = CompareOptions.IgnoreCase
)
vb
Public Sub HighlightRanges(
    text As String,
    foreColor As Color,
    options As CompareOptions = CompareOptions.IgnoreCase
)

Parameters

NameTypeDescription
textString

A string that identifies target text blocks to be highlighted or custom painted.

| | foreColor | Color |

A custom foreground color used to paint text blocks.

|

Optional Parameters

NameTypeDefaultDescription
optionsCompareOptionsIgnoreCase

An object that specifies text comparison settings used to locate target text blocks.

|

Remarks

The HighlightRanges method locates all text blocks that contain the string specified by the text parameter, and then paints the text blocks with the foreColor color.

Use the HighlightWords methods to highlight or custom paint whole words.

See Also

TextEditCustomHighlightTextEventArgs Class

TextEditCustomHighlightTextEventArgs Members

DevExpress.XtraEditors Namespace