Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi Statictext font colour change without styles

Tags:

delphi

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!

like image 206
TobyFox1997 Avatar asked Jan 29 '15 12:01

TobyFox1997


2 Answers

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.

like image 116
David Heffernan Avatar answered Oct 21 '22 00:10

David Heffernan


Set the static text Transparent property to False

like image 3
dwrbudr Avatar answered Oct 21 '22 02:10

dwrbudr