 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Mark Guerrieri Guest
|
Posted: Fri Mar 03, 2006 9:03 am Post subject: TCustomControl color problem |
|
|
Using BDS2006 on XP w/ themeing enabled.
I have a custom control that derives from TCustomControl. This control can
contain (parent) other controls, similar to a TPanel for example.
I place my custom control on a TScrollBox. My control has its color set to
some color, say clBlue for example, while the TScrollBox is set to
clBtnFace.
I drop a TPanel on my control and set its color to, say, clRed. In design
time, everything looks exactly as it should. At run time, the TPanel ALWAYS
draws itself using the color of the TScrollBox! Event if I set ParentColor
to true, it still draws the color of the custom control's parent, rather
than the color assigned to it. The same holds true for other controls
dropped on to my control that have transparant parts, like a TCheckBox. The
background is ALWAYS drawn in the color of the TScrollBox instead of the
color of my custom control. I have tried setting csOpaque in the
ControlStyle, with no change.
I also get the same results if I put my component directly on a form.
Controls that it contains paint themselves using the form's color instead of
my component's. What am I doing wrong?
Mark |
|
| Back to top |
|
 |
Clayton Arends Guest
|
Posted: Fri Mar 03, 2006 5:03 pm Post subject: Re: TCustomControl color problem |
|
|
What you describe is not default behavior so perhaps posting your code might
shed some light.
- Clayton |
|
| Back to top |
|
 |
Mark Guerrieri Guest
|
Posted: Fri Mar 03, 2006 6:03 pm Post subject: Re: TCustomControl color problem |
|
|
| Quote: | What you describe is not default behavior so perhaps posting your code
might shed some light.
|
I figured it out- it had to do with ParentBackground defaulting to true,
which was causing my control to paint its background using its parent
background when contained controls requested a background repaint.
Mark |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|