【发布时间】:2013-05-22 02:57:59
【问题描述】:
自 XE2 以来,有多个主题可用于您的应用程序。例如。 Carbon 将 TListView 的背景颜色更改为 gray。
有没有办法得到这种颜色?
TListView.Color 返回 white,尽管背景是某种 gray。
我尝试将 StyleServices.GetElementDetails 与这样的 sn-p 一起使用:
var lColor: TColor;
lDetails: TThemedElementDetails;
if StyleServices.Enabled then
begin
lDetails := StyleServices.GetElementDetails(tlListviewRoot);
StyleServices.GetElementColor(lDetails, ecFillColor, lColor);
end;
但是GetElementColor失败并返回false。我使用了错误的参数吗?还是我的方法错了。
可以在这里找到可能的参数:
TThemedListView
TElementColor
谢谢。
P.S.:我也读过this post,但到目前为止答案对我没有帮助。
【问题讨论】:
标签: delphi listview themes background-color