Back to Devexpress

TextEditCustomHighlightTextEventArgs.HighlightWords(String, Action<TextEdit.Block>, CompareOptions) Method

windowsforms-devexpress-dot-xtraeditors-dot-texteditcustomhighlighttexteventargs-dot-highlightwords-x28-system-dot-string-system-dot-action-devexpress-dot-xtraeditors-dot-textedit-dot-block-system-dot-globalization-dot-compareoptions-x29.md

latest3.1 KB
Original Source

TextEditCustomHighlightTextEventArgs.HighlightWords(String, Action<TextEdit.Block>, CompareOptions) Method

Highlights or custom paints whole words.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public void HighlightWords(
    string text,
    Action<TextEdit.Block> settings,
    CompareOptions options = CompareOptions.IgnoreCase
)
vb
Public Sub HighlightWords(
    text As String,
    settings As Action(Of TextEdit.Block),
    options As CompareOptions = CompareOptions.IgnoreCase
)

Parameters

NameTypeDescription
textString

The text of target words.

| | settings | Action<TextEdit.Block> |

Allows you to specify display settings or a custom painter for the target words.

|

Optional Parameters

NameTypeDefaultDescription
optionsCompareOptionsIgnoreCase

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 highlights or custom paints the found words as specified by the settings object. The settings parameter allows you to customize word display options:

  • Specify the background and foreground colors.
  • Add padding.
  • Supply a painter that will paint text. For instance, your painter can draw text using a custom font, or display an icon or smiley.

The following characters are considered word separators:

See Also

TextEditCustomHighlightTextEventArgs Class

TextEditCustomHighlightTextEventArgs Members

DevExpress.XtraEditors Namespace