Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do restore the label background colour to mimic its’ GroupBox back

Status
Not open for further replies.

JerryAttrick

Technical User
May 14, 2005
23
0
0
NZ
Part of a project has labels in a GroupBox. Originally if I changed the GroupBox colour then the label background colour matched the box. The same was true when I changed back.

Recently I’ve been experimenting with changing colours. After my tinkering, if I change the GroupBox background colour the label background colour no longer mimics it. Clearly I’ve unwittingly changed a setting, but I can’t figure out what. How can I get back to the original setting?
 
maybe try something like

label1.color := groupbox1.color;

[bobafett] BobbaFet [bobafett]

Everyone has a right to my opinion.
Great Delphi Websites faq102-5352
 
Thanks BobbaFET. Since writing the plea for help I got b****y-minded and tried changing every setting in the Properties section in Object Inspector. I found the trick is to change the ‘ParentColor’ back to TRUE. If you ever change the background colour of a label to be different to the background colour of the GroupBox then the ParentColor changes to FALSE (I had what my boss used to call a BFO - “Blinding Flash of the Obvious” ! ). Now the label colour slavishly follows the GroupBox colour once more, until such time as one changes it to something different.

Jerry
 
There is also the Transparent property that deserves attention
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top