自XE2以来,有几个主题可用于您的应用程序。例如碳,它改变TListView的背景色为灰色,除了其他的东西。
有什么办法可以得到这种颜色吗?
TListView.Color返回白色,虽然背景是某种灰色。
我尝试将StyleServices.GetElementDetails与这样的片段一起使用:
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.:我也读过这个职位,但到目前为止答案并没有帮助我。
发布于 2013-05-27 10:23:15
若要获取具有StyleHook实现的StyleHook的背景色,请执行以下操作:
uses Vcl.Themes;
var Color : TColor;
Color := StyleServices.GetStyleColor(scListView);https://stackoverflow.com/questions/16770014
复制相似问题