启用主题后 TDBNavigator 出现异常行为
我最近在 Delphi 2007 中使用第 3 方导航器组件时遇到了一些不寻常的行为,即在将“Flat”属性设置为 True 时,按钮没有像启用主题时那样保持平坦,但一旦我取消选中从内部启用主题,就会出现这种情况我的项目文件并重新编译了我的程序。这显然似乎不对,因为我尝试过的另一个第 3 方导航器组件在“Flat”设置为 True 并启用主题的情况下相应执行。然后,我对 Delphi 的 TDBNavigator 进行了相同的尝试,并再次遇到了与第一个第 3 方 Navigator 组件相同的问题。在网上研究这个问题时,我发现除了以下事实之外几乎没有什么发现:与以前版本的 Delphi 不同,Delphi 2007 支持开箱即用的主题应用程序,而不是必须添加另一个组件来支持 WinXP 主题。综合考虑,我希望其他人在主题应用程序中使用 TDBNavigator 或其他第 3 方导航器组件并将 flat 属性设置为 true 时可能遇到类似的问题。如有任何有关此事的意见或建议,我们将不胜感激。
I recently experienced some unusual behavior in using a 3rd party Navigator component in Delphi 2007 whereby upon setting the 'Flat' property to True, the buttons didn't remain Flat as they should with Themes Enabled but did so once I unchecked Enable Themes from within my project file and recompiled my program. This obviously didn't seem right since another 3rd party Navigator component I experimented with performed accordingly with 'Flat' set to True and Themes Enabled. I then tried the same with Delphi's TDBNavigator and once again I experienced the same problem as I did with the first 3rd party Navigator component. In researching this matter online, I have found very little other than the fact that, unlike previous versions of Delphi, Delphi 2007 supports Themed Applications out of the box as opposed to having to add another component to support WinXP Themes. All considered, I am hoping that someone else may have experienced similar problems in using TDBNavigator or other 3rd party Navigator components in Themed Applications with the flat property set to true. Any comments or suggestions regarding this matter are appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Delphi 2007 中添加了主题支持,但不适用于 100% 的 VCL(例如,网格没有主题支持)。我怀疑这就是您在使用 TDBNavigator 时遇到的问题。
至于您的“第3方导航器”问题,不可能给您任何建议,因为您没有指出您正在使用哪个“第3方导航器”控件。在不知道具体组件名称的情况下,您没有向我们提供任何信息来帮助我们。
Delphi 2010 提供完整的主题支持,包括网格。我还没有测试过 DBNavigator,因为我从 Delphi 2 左右就没有使用过它。但请注意,Delphi 2009/2010 引入了旧代码的其他问题,因为从 Delphi 2009 开始,VCL 是基于 Unicode 的。某些使用字符串并假设 Char 大小为 1 字节的代码可能会出现问题。
Theme support was added to Delphi 2007, but doesn't apply to 100% of the VCL (grids, for example, don't have theme support). I'd suspect that's the issue you're having with the TDBNavigator.
As far as your "3rd party Navigator" problems, it's impossible to give you any advice because you didn't indicate which "3rd party Navigator" controls you're using. Without knowing the specific component names, you've given no information to us to use in trying to help.
Delphi 2010 provides full theme support, including grids. I haven't tested the DBNavigator, as I haven't used it since Delphi 2 or so. Note, however, that Delphi 2009/2010 introduces other issues with older code, because as of Delphi 2009 the VCL is Unicode-based. Some code that uses strings and assumes that a Char is 1 byte in size can be an issue.
TDBNavigator、TSpeedButton 错误的解决方法
http://blog.issamsoft.com/ index.php?q=en/node/37
Workaround on TDBNavigator,TSpeedButton bug
http://blog.issamsoft.com/index.php?q=en/node/37