Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Windows Theme for a single control deactivating?

364 views
Skip to first unread message

Bernhard Roos

unread,
Feb 7, 2008, 5:56:25 AM2/7/08
to
Hello,
is it possible programmatically for a single control (for example a
TCheckBox Control) the Windows Theme to deactivate? All other controls
(of TCheckBox and other classes) should use still the Windows Themes.
Only this one control should use classic style.

Best wishes
Bernhard

Yorai Aminov (TeamB)

unread,
Feb 7, 2008, 6:22:32 AM2/7/08
to
Bernhard Roos wrote:

> is it possible programmatically for a single control (for example a
> TCheckBox Control) the Windows Theme to deactivate?

You can call the SetWindowTheme method to disable themes for a
specific window handle:

SetWindowTheme(Handle, nil, '');

If the window is recreated, however, you'll have to call
SetWindowTheme again. You can create a descendant class and override
the CreateWnd method so you can call SetWindowTheme immediately after
the window is created.

--
Yorai Aminov (TeamB)
(TeamB cannot answer questions received via email.)
Shorter Path - http://www.shorterpath.com
Yorai's Page - http://www.yoraispage.com

Bernhard Roos

unread,
Feb 7, 2008, 8:52:24 AM2/7/08
to
Thanks for the answer. This works.

But my hope was, that I am able to change the Color and Font.Color if I
deactivate the Window Theme for this control. But I'm still not able to
change the color and font.color.

Is there a way to solve this without write a descendent of the control?

Best wishes
Bernhard

Yorai Aminov (TeamB) schrieb:

Yorai Aminov (TeamB)

unread,
Feb 7, 2008, 10:26:09 AM2/7/08
to
Bernhard Roos wrote:

> Is there a way to solve this without write a descendent of the
> control?

Depends on the control.

0 new messages