delphidelphi-2010form-designer

TButtons and "runtime themes": peculiar behavior


Have you seen this?

I have a little utility application (for easy load / test xml generation from CDS and/or DBGo), and I had put some buttons (the poorest button of all, TButton) to trigger some actions.

I never paid attention to appearance, because I'm the only one that uses it. So today I added a new button, and they appeared different from the others in designer - but not when running. It's just an copy and paste process (change the button name, caption and event - the rest is equal to the origin).

When I looked the other buttons have an grey gradient and round corners, the button I copied and pasted not (just a bare rectangle). When running all buttons where just bare rectangles.

So I discovered that on designer, W7 and delphi are applying themes. On running, they are obeying the Project/Options/Application/Enable runtime themes flag.

This is annoying. There's a way to make Delphi doing that obeying the project options flag on forms designer? (Or even manually if is not possible to automate that)?

EDIT: The form in question

The toolbars on the form are from CNWizards ;-)

EDIT II:

Apart of disabling themes for the IDE executable, all buttons get themed equally if the form (or project) is reloaded. But it's really weird.


Solution

  • If you want to enable/disable themes in the IDE, then open the properties of bds.exe, select the 'Compatibility' tab, and make sure that the 'Disable visual themes' checkbox is unchecked/checked.

    Programs that you run from the IDE will inherit the compatibility settings of the IDE.