tbuttons和“运行时主题”:特殊行为
你见过这个吗?
我有一个小实用程序应用程序(用于从 CDS 和/或 DBGo 轻松加载/测试 xml 生成),并且我放置了一些按钮(最差的按钮,TButton)来触发一些操作。
我从来不注重外表,因为我是唯一使用它的人。所以今天我添加了一个新按钮,它们在设计器中看起来与其他按钮不同 - 但在运行时则不然。这只是一个复制和粘贴过程(更改按钮名称、标题和事件 - 其余的与原点相同)。
当我查看其他按钮有灰色渐变和圆角时,我复制并粘贴的按钮没有(只是一个裸露的矩形)。运行时所有按钮都只是裸露的矩形。
所以我发现在designer上,W7和delphi都在应用主题。运行时,它们遵循 Project/Options/Application/Enable runtime theme
标志。
这很烦人。有没有办法让 Delphi 遵守表单设计器上的项目选项标志? (或者如果无法自动化,甚至手动)?
编辑:
表单上的工具栏来自 CNWizards ;-)
编辑 II:
除了禁用 IDE 可执行文件的主题之外,如果重新加载表单(或项目),所有按钮都会获得相同的主题。 但这真的很奇怪。
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 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果要在IDE中启用/禁用主题,请打开
bds.exe
的属性,请选择“兼容性”选项卡,并确保未经检查/检查“禁用视觉主题”复选框。您从IDE运行的程序将继承IDE的兼容性设置。
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.
Delphi IDE 本身是一个应用程序,设计者绘制表单的方式是使用 IDE 应用程序的设置(delphi32.exe 或 bds.exe 的兼容性设置),所以答案是否定的。 IDE 版本之间的默认行为有所不同,例如。相反的行为(不是绘画主题)过去发生过。
Delphi IDE itself is an application and the way the designer draw the form is using the setting for the IDE application (delphi32.exe or bds.exe's compatibility settings) so the answer is no. The default behaviour is different between IDE versions, for eg. the opposite behaviour (not drawing themed) happened in past.