David Novák
David Novák

Reputation: 103

Custom background color in Delphi with runtime themes enabled

I'm creating a bunch of Panels on runtime and I want to change their color. Color property doesn't work and I don't want turn of runtime themes.

I'm using Delphi XE3.

Upvotes: 9

Views: 2536

Answers (1)

bummi
bummi

Reputation: 27367

Remove seClient from StyleElements and set ParentBackground to false.

aPanel.StyleElements :=  Panel1.StyleElements - [seClient];
aPanel.ParentBackground := False;
aPanel.Color := clLime;

Upvotes: 9

Related Questions