自定义 TAdvSmoothListBox 项目颜色
我刚刚安装了 Delphi 的 TMS 组件,在 TAdvSmoothListBox 中我想自定义颜色每个项目。
我实际上正在使用 .ItemAppearance.Fill.Color 但它用相同的颜色填充所有项目。
谁能建议我如何单独设置每个项目的颜色?
谢谢
I've just installed TMS Components for Delphi and in TAdvSmoothListBox I would like to customize colors for each item.
I am actually using the .ItemAppearance.Fill.Color but it fills all the items with the same color.
Can anyone suggest me how to set the colors for each item separately ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
OnItemBkgDraw
事件绝对是您自己绘制背景所需要的。但如果我必须这样做,背景永远不会看起来很好。所以我会让别人来画。幸运的是,我们可以使用 Fill.Fill 方法来生成一个漂亮的背景,该背景与当前项目外观和组件的整体外观兼容。
这是您的 OnItemBkgDraw 处理程序:
The event
OnItemBkgDraw
is definitely what you need to draw the background yourself.But if I had to do this the background would never look really nice. So I would let somebody else do the drawing. Fortunately we can use the
Fill.Fill
method which will generate a nice background which is compatible with the current item appearance and the overall look of the component.This is your
OnItemBkgDraw
handler:我认为 Daemon_x 就在这里,我认为默认情况下您不能使用 TAdvSmoothlistbox 的属性/方法来执行此操作。
您可以轻松更改字体、图像等,但背景颜色需要使用
OnItemBkgDraw
和/或OnItemDraw
事件来完成。(截至版本 2.4.0.1)
I think Daemon_x is right here, i dont think you can do this with the properties/methods of the TAdvSmoothlistbox by default.
You can easily change fonts, images etc, but the background color needs to be done using the
OnItemBkgDraw
and/or theOnItemDraw
events.(as at version 2.4.0.1)