是否有类似的行为是正确的主题一TBitBtn一个组成部分? [英] Is there a component that behaves like a TBitBtn that is properly themed?

查看:119
本文介绍了是否有类似的行为是正确的主题一TBitBtn一个组成部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人是否知道现有的Delphi组件,也就是

Is anyone aware of an existing Delphi component, that is


  • 正确的主题就像一个TButton(具有淡入/淡出后,鼠标悬停效果在Windows 7及以上)

  • 支持像TBitBtn但没有使用图像列表(以同样的方式做TBitBtn)字形。

如果不存在这样的组件可用,这将是可能的修改TBitBtn的主题的行为,以复制该一个TButton的?我不是主题化的高手,但也许你可以从ThemeServices得到不同的淡入淡出的阶段?或者,你不得不从热和非热态之间avaraging自己创建的淡入淡出效果?

If there is no such component available, would it be possible to modify TBitBtn's themed behaviour to replicate that of a TButton? I'm not a master of theming, but maybe you could get the different fade-in fade-out phases from ThemeServices? Or would you have to create the fade effect yourself from avaraging between the hot and non-hot state?

推荐答案

这VCL的 TButton的使用图像列表是实现图像支持的原因怎么基础Win32 按钮控件支持的图像。如果你想有淡入充分主题支持/淡出动画,那么你需要使用本机的控制。嗯,你可以尝试自行复制这些影响,但我认为成功的几率很低,而且你永远是受制于更换主题皮肤未来的变化。这是什么咬你 TBitBtn

The reason that the VCL TButton implements image support using image lists is that is how the underlying Win32 BUTTON control supports images. If you want to have the full theme support with fade-in/fade-out animations then you need to use the native control. Well, you could try to replicate these effects yourself, but I think that the chance of success are low, and you'd always be subject to future changes in themeing. Which is what is biting you with TBitBtn.

所以,解决问题的方式是使用 TButton的控制与图像列表。 TButton的的实施使用专用图像列表在任何情况下,因为底层控制所需要的指标是固定的。因此, TButton的控制将图像的副本反正。所以,你可以很容易地编写自己的按钮控制,根据 TButton的或它的一个祖先,暴露字形属性。然后推了字形到一个图像列表,然后到基础Win32控制。

So, the way to solve your problem is to use a TButton control with an image list. The implementation of TButton uses a private image list in any case because the indices needed by the underlying control are fixed. So the TButton control takes a copy of your images anyway. So you could easily write your own button control, based on TButton or one of its ancestors, that exposes a glyph property. And then pushed that glyph into an image list, and then in to the underlying Win32 control.

如果您有不支持的ImageList 的ImageIndex 属性德尔福版本,你需要实现它包装在Win32自己的按钮控制按钮控制。

If you have a Delphi version that does not support ImageList and ImageIndex properties, you'll need to implement your own button control that wraps the Win32 BUTTON control.

这篇关于是否有类似的行为是正确的主题一TBitBtn一个组成部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆