TBitBtn only displays legacy Windows theme usage

I created a manifest file for my Delphi 6 application so that it can display controls according to the theme defined by Windows (6.0 controls). Everything looks great except for the component TBitBtn

, which is rendered using the old theme:

Legacy TBitBtn

The behavior is the same in Windows XP and Windows 7, regardless of the current theme, even if no image is assigned a component TBitBtn

.

Now when I place a normal component TButton

on the form, it displays OK. If I then programmatically set an image to this button at runtime (using SendMessage(Handle, BM_SETIMAGE, IMAGE_ICON, LPARAM(Icon))

) it immediately reverts its style back to deprecated.

Is there a way to make it TBitBtn

use the correct style or render the glyph on a regular one TButton

without falling back to deprecation in Delphi 6?

+3


source to share


1 answer


In Delphi 6, it is not enough to just add the comctl32 v6 manifest. You also need to change the VCL to keep up with the topic. A control TBitBtn

is a VCL control that, in its Delphi 6 incarnation, knows nothing about those XP themes.

The standard way to deal with this is to add third party software that does the magic. This is the XP theme manager by Mike Lieschke.



Here is a screenshot from a Delphi 6 application that has a theme manager:

enter image description here

+5


source







All Articles