[]
        
(Showing Draft Content)

C1.Win.Drawing.StringRendererGDIPlus.HighlightSubstring

HighlightSubstring Method

HighlightSubstring(Graphics, Font, StringFormat, Brush, Rectangle, string, Brush, string, int)

Draws text and highlight a part of that text with a special background.

Declaration
public static void HighlightSubstring(Graphics graphics, Font font, StringFormat stringFormat, Brush foreBrush, Rectangle bounds, string text, Brush highlightBrush, string substring, int substringStartIndex)
Parameters
Type Name Description
Graphics graphics

The device context in which to draw the text.

Font font

The Font to apply to the drawn text.

StringFormat stringFormat

The text layout information.

Brush foreBrush

The Brush to apply to the drawn text.

Rectangle bounds

The Rectangle that represents the bounds of the text.

string text

The text to draw.

Brush highlightBrush

The highlight Brush of substrings.

string substring

The substring to highlight.

int substringStartIndex

The position at which the substring starts.

HighlightSubstring(Graphics, Font, StringFormat, Brush, Rectangle, string, Brush, IList<CharacterRange>)

Draws text and highlight a parts of that text with a special background.

Declaration
public static void HighlightSubstring(Graphics graphics, Font font, StringFormat stringFormat, Brush foreBrush, Rectangle bounds, string text, Brush highlightBrush, IList<CharacterRange> substringRanges)
Parameters
Type Name Description
Graphics graphics

The device context in which to draw the text.

Font font

The Font to apply to the drawn text.

StringFormat stringFormat

The text layout information.

Brush foreBrush

The Brush to apply to the drawn text.

Rectangle bounds

The Rectangle that represents the bounds of the text.

string text

The text to draw.

Brush highlightBrush

The highlight Brush of substrings.

IList<CharacterRange> substringRanges

Positions and lengths of all occurrences of substrings to highlight.