[]
        
(Showing Draft Content)

C1.Win.Drawing.StringRendererGDI.HighlightSubstring

HighlightSubstring Method

HighlightSubstring(Graphics, Font, TextFormatFlags, Color, Rectangle, string, Color, string, int)

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

Declaration
public static void HighlightSubstring(Graphics graphics, Font font, TextFormatFlags textFormatFlags, Color foreColor, Rectangle bounds, string text, Color highlightColor, string substring, int substringStartIndex)
Public Shared Sub HighlightSubstring(graphics As Graphics, font As Font, textFormatFlags As TextFormatFlags, foreColor As Color, bounds As Rectangle, text As String, highlightColor As Color, substring As String, substringStartIndex As Integer)
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.

TextFormatFlags textFormatFlags

The text layout information.

Color foreColor

The Color to apply to the drawn text.

Rectangle bounds

The Rectangle that represents the bounds of the text.

string text

The text to draw.

Color highlightColor

The highlight Color of substrings.

string substring

The substring to highlight.

int substringStartIndex

The position at which the substring starts.

HighlightSubstring(Graphics, Font, TextFormatFlags, Color, Rectangle, string, Color, IList<CharacterRange>)

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

Declaration
public static void HighlightSubstring(Graphics graphics, Font font, TextFormatFlags textFormatFlags, Color foreColor, Rectangle bounds, string text, Color highlightColor, IList<CharacterRange> substringRanges)
Public Shared Sub HighlightSubstring(graphics As Graphics, font As Font, textFormatFlags As TextFormatFlags, foreColor As Color, bounds As Rectangle, text As String, highlightColor As Color, substringRanges As IList(Of CharacterRange))
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.

TextFormatFlags textFormatFlags

The text layout information.

Color foreColor

The Color to apply to the drawn text.

Rectangle bounds

The Rectangle that represents the bounds of the text.

string text

The text to draw.

Color highlightColor

The highlight Color of substrings.

IList<CharacterRange> substringRanges

Positions and lengths of all occurrences of substrings to highlight.