Entry No.
512
|
VCL - Standard - StdCtrls - TLabel
TLabel does not show the correct background color after it is loaded if the color is clWindow
|
|
| 1.02 |
2.01 |
3.0 |
3.01 |
3.02 |
4.0 |
4.01 |
4.02 |
4.03 |
5.0 |
5.01 |
6.0 |
6.01 |
6.02 |
Kylix 1.0 |
| N/A | N/A | Exists | Exists | Exists | Exists | Exists | Exists | Exists | Exists | Exists | Exists | Exists | Exists | N/A |
|
|
|
Description | |
Reported by Mike Lischke; checked by Reinier Sterkenburg
To reproduce:
Take any TForm, place a label on it, set its Color property to clWindow.
Switch to "View as text" and switch back to "View as form".
Now the label's color is clBtnFace (or whatever color the parent of the label has). |
|
|
Solution / workaround | |
|
Explicitly set the label's Color to clWindow after creation.
|
|
|
User-contributed comments | |
AzzaAzza69 11 Oct 2001 08:48 AM GMT |
The problem is due to the fact that the TLabel is inherited from the TControl that has the default for the Color property set to clWindow and hence is not streaming it away when writing the DFM:
controls.pas:
TControl = class(TComponent)
...
property Color: TColor read FColor write SetColor stored IsColorStored default clWindow;
...
|
|