Page 1 of 1

Theme and Background Color

Posted: 12 Jan 2015, 10:10
by Mex
Hi!

Found strange behavior.

Set forms background color to white or any other color.
Add Checkbox to form and change background color to same color as forms bg.

When Aero theme is on, then checkbox background color is not selected color, but system color?


Regards
Meelis

Re: Theme and Background Color

Posted: 12 Jan 2015, 20:36
by TiKu
Hi,

As documented: "This property [CheckBox.BackColor] isn't supported for themed checkboxes."

Regards
TiKu

Re: Theme and Background Color

Posted: 13 Jan 2015, 10:47
by Mex
Hi,

I always forget to RTFM :D


But is there a way to use BG color, DrawThemeParentBackground API for example?


Regards
Meelis

Re: Theme and Background Color

Posted: 14 Jan 2015, 08:42
by TiKu
In the past I've tried hard to support a custom background color if the controls are themed. As far as I remember there have been two problems:
  1. On TabStrip controls, the controls should be drawn with a transparent background. So there was a (solvable) logical problem: Should the BackColor be ignored then or should the background become opaque? This problem can be solved by introducing some additional property or by allowing a magic value (e.g. -1) for the BackColor property - but it would be difficult to implement it in a way that would not break existing applications.
    Additionally I remember code-wise problems, but I'm not sure anymore whether these problems existed only because I've been trying to keep compatibility with existing applications.
  2. As far as I remember, it was not possible to customize the foreground (text) color. Being able to change one color but not the other, seemed inconsistent.
I think I'll check out the possibilities again and then decide whether I will
  • implement it at all.
  • break compatibility. This would likely result in a new major version of the library, requiring new GUIDs and therefore also some kind of upgrade tool that can be used to upgrade existing projects in a comfortable way.
I hope that by sunday evening I'll know what I'll do. If the result will be a new major version, you should not expect it anytime soon (i.e. not before spring), because it would mean quite some work and I would also think hard to find other things that could be improved by breaking compatibility.

Regards
TiKu

Re: Theme and Background Color

Posted: 14 Jan 2015, 11:16
by Mex
Breaking compatibility is not a good idea, i think. If it's too hard to implement, then let it be.


Thnx
Meelis

Re: Theme and Background Color

Posted: 25 Jan 2015, 18:48
by TiKu
Hi,

I've finally found time to check out the possibilities. I did remember correctly: Only the background color could be changed. Allowing to customize the background color, but not the text color does not seem very useful.
I also tried to implement a transparent background mode instead, so that the checkbox would appear transparent not only on tab strip controls, but also on Forms. But so far all my attempts failed.

Regards
TiKu