TE Edit Control .NET Core / .NET Framework Help
Product page

TerGetTextColor

Get the foreground and background colors for the specified font id.

bool TerGetTextColor( FontId, out TextColor, out TextBkColor)
int FontId;

The editor font id to retrieve color. A valid font id would a value between 0 and TotalFonts - 1.

You can also use this function to get the text color for a stylesheet item by specifying the style id as a negative value for this parameter. Also, use the following constant to specify normal or the current style item:

SID_NORMAL:Normal style item
SID_CUR:Style item being current edited
Color TextColor;variable to a double word location to receive the text foreground color.
Color TextBkColor; variable to a double word location to receive the text background color.

Return Value: This function returns true when successful.

Example:

// This example retrieves the text foreground and background color for font id: 0.

Color TextColor, TextBkColor;

TerGetTextColor(0,out TextColor,out TextBkColor);