TBitBtn displays only using legacy Windows theme - delphi

I created the manifest file for my Delphi 6 application so it can display controls according to the theme defined by Windows (controls 6.0). Everything looks fine, except TBitBtn component, which is displayed using the legacy theme:
The behavior is the same on Windows XP and Windows 7, regardless of the current theme, even when no image is assigned to the TBitBtn component.
Now, when I put a regular TButton component on a form, it displays OK. If I then programmatically set an image to this button in runtime (using SendMessage(Handle, BM_SETIMAGE, IMAGE_ICON, LPARAM(Icon))), it immediately reverts its style to the legacy one.
Is there a way to either make TBitBtn use a proper style, or to display glyph on a regular TButton without reverting to the legacy one in Delphi 6?

In Delphi 6 it is not enough just to add the comctl32 v6 manifest. You also need to modify the VCL to be theme aware. The TBitBtn control is a VCL implemented control that, in its Delphi 6 incarnation, does not know anything about XP themes.
The standard way to deal with this is to add some third party software that performs the magic. That's the XP theme manager from Mike Lischke.
Here's a screenshot from a Delphi 6 application that includes the theme manager:

Related

Delphi 11.2 Speedbuttons don't show border at design time

Running windows 10 21H2. Just upgraded to Delphi 11.2 (from 11.1).
Speedbuttons (with Flat=False) do not show the button rectangle at design time. It does appear at runtime.
Most/all of our VCL projects have an empty style name. I have noticed that if I set the Stylename for the button (or even the form), then it shows normally. But is this the best way of handling it? Is there a global setting somewhere that can restore "normal" behaviour?
In 11.2 the Form Designer Options have a new option Mimic the system style, which is active by default. Disabling that should solve your problem.
Form Designer Options

How to apply DEFAULT style for all the project

I work with VCL and FMX on this application, we are updating pack by pack of the software to FMX.
Something I did on the code, changed the STYLE of the application.
On the design view, it is the DEFAULT style, without any style edition.
However, when the application is compiled the STYLE for all FMX forms are changed, and the screen become a mess, the buttons disappears, etc...
I don't know what has been done to achieve it, but I could not find a manner to set all project to DEFAULT LAYOUT.
I tried to use
TStyleManager.SetStyleFromFile('light.style')
using the samples from delphi folder.
However, noon of the .STYLE are the DEFAULT.
Is there any DEFAULT.STYLE?
Or any manner to set DEFAULT.STYLE on RUNTIME?

Doubling component on "Standard" palette page

Recently I've installed the new Embarcadero Delphi 10.3 Rio, and noticed that some components on the Standard toolbar page are being doubled. Particularly, the doubled components are TMainMenu, TActionList and others. These components live in Embarcadero's Standard package.
I've looked through the list of installed packages and found some Embarcadero FMX packages with these components. Unchecking those packages (need to uncheck two FMX packages) didn't give a result.
Any idea how to fix this?
This is an IDE bug that affects only components in Standard VCL or FMX package.
Standard VCL controls are displayed twice on the Component toolbar https://quality.embarcadero.com/browse/RSP-19518
It is harmless, so you don't have to do anything about it.
Which standard package controls will be duplicated (or not at all) depends on the context.
If you don't have any application or package open, you will see both VCL and FMX controls on the toolbar (no duplicates). When you hover with the mouse over the component icon hint will tell you to which package control belongs.
If you have VCL based application or package open, you will have duplicate VCL standard controls. On the other hand if you have FMX based application or package open you will see duplicates from FMX standard controls package.
However, above behavior is not carved in stone. It is just what you can observe most of the time. Component toolbar behavior can be rather unpredictable at times.

Removing "3D look" from Delphi controls

Standard Delphi controls (panels, buttons etc.) all have this bevel effect (white line on top and on the left) that gives them a 3D feel but today it makes them look old fashioned.
Is there a way to remove this "3D look" at least in Delphi 7?
Some controls have a Ctl3D property that you can turn off.
For a TPanel, you can also turn off its Bevel... properties.
What you really should do instead is enable Visual Styles in your app so it has a themed look on Windows XP and later. Delphi 7 did not natively support Visual Styles, but you can use Mike Lischke's XP Theme Manager component to handle that (it was incorporated directly into later VCL versions).

Why does the Delphi 2010 TRibbon control "flicker" on Windows XP, but not Vista/7?

I've noticed that when I use TRibbon control that comes with Delphi 2010, it works flawlessly on my Windows 7 system. However, the application has some weird painting issues on a Windows XP system with the "classic theme" (I haven't tried the playschool theme).
I know there are other Ribbon components available from DevExpress and TMS Software, however purchasing a 3rd party control is not an option for this project.
Has anyone had this issue, or know of a solution?
Most likely because Windows 7 uses "Desktop Compositing", which essentially means that a component is drawn to an off-screen bitmap and then copied onto the display. In XP, a component typically draws directly onto the display (which can cause flicker if the component first erases what's there and draws over the "clean slate").
Delphi supports double-buffering, which accomplishes the same thing. If you set the ribbon's DoubleBuffered property to True (in code, since it's not published) then that should avoid the flicker (at the cost of extra memory allocated and moved around when drawing)--I should say, however, that I haven't actually tried it with TRibbon.
Note that there is no additional overhead when running on Windows 7 (or Vista, for that matter) if you set DoubleBuffered to True. The VCL has code the skips the off-screen bitmap business when running on a version of Windows that does desktop compositing.
Most likely this is a bug in the TRibbon code, the Microsoft ribbon renders perfect in both XP and Win7.
If you change your XP theme does the Minimise button shown in the image change to reflect your theme change? If this is the case the Ribbon code has probably been optimised for Vista and 7 and not been developed to run perfectly under XP.
You cant really resolve it unless you can modify the TRibbon code.

Resources