Text colour - %tc

In this section:

By default, the text in a format window is coloured using the 'window text' colour that the user can select from the Control Panel in the Program Manager. This colour is returned by GetSysColor(COLOR_WINDOWTEXT). %tc (Text Colour) is used to specify the text colour for subsequent text and controls (until another %tc overrides it). %tc takes one integer argument which is typically created using RGB@.

For example:

 i=winio@( '%tcRed&',  RGB@(255,0,0))
 i=winio@(' %tcGreen&',RGB@(0,255,0))
 i=winio@(' %tcBlack', RGB@(0,0,0))

It is often desirable to base the new colour on the default set by calling GetSysColor (see the description of %bg (Background Colour) in Background colour for details of how to do this). An argument value of -1 resets the colour to the 'window text' colour.

Alternatively one of the standard colours (black, white, grey, red, green, blue, and yellow) can be specified by enclosing the colour name in square brackets (for example: %tc[red]).

Note that the text colour for a given control can be changed dynamically (after the window has been created) by calling the subroutine SET_CONTROL_TEXT_COLOUR@.



Copyright © 1999-2023 Silverfrost Limited