Skip to main content
All docs
V23.2

TextEditCustomHighlightTextEventArgs.HighlightWords(String, Color, Color, CompareOptions) Method

Highlights whole words using custom foreground and background colors.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public void HighlightWords(
    string text,
    Color foreColor,
    Color backColor,
    CompareOptions options = CompareOptions.IgnoreCase
)

Parameters

Name Type Description
text String

The text of target words.

foreColor Color

A custom foreground color to paint the target words.

backColor Color

A custom background color to paint the target words.

Optional Parameters

Name Type Default Description
options CompareOptions IgnoreCase

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

Remarks

The HighlightWords method locates all whole words that match the text parameter according to the options text comparison setting. The method then paints the found words with the foreColor and backColor colors.

The following characters are considered word separators:

See Also