TextEditCustomHighlightTextEventArgs.HighlightWords(String, Color, CompareOptions) Method
Highlights whole words using a custom foreground color.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
public void HighlightWords(
string text,
Color foreColor,
CompareOptions options = CompareOptions.IgnoreCase
)
Parameters
Name | Type | Description |
---|---|---|
text | String | The text of target words. |
foreColor | Color | A custom foreground color used 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 color.
The following characters are considered word separators:
- Punctuation marks (see Char.IsSeparator)
- White space (see Char.IsWhiteSpace)
- Separator characters (see Char.IsSeparator)
Use the HighlightRanges methods to highlight or custom paint all occurencies of a sub-string, even if they are part of words.