Search code examples
delphi

Delphi Statictext font colour change without styles


I'm wanting to change my StaticText font colour from black to clBlue. How can I go about this?

Currently I'm doing

StaticText.Font.Color := clBlue;

but that is making no difference to the colour.

What can I do? Thanks!


Solution

  • The TStaticText control is a wrapper around the Win32 STATIC control. When themes are enabled, the system ignores the font color that is specified, and uses the color specified by the theme. Other standard system controls behave in this manner too.

    If you want to be able to specify the color of the text, you will need to use a different control. For instance, TLabel.