Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

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

#Parameters

Name Type Description
text String

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

Name Type Default Description
options CompareOptions IgnoreCase

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