4
由於XE2,有幾個主題可以用於您的應用程序。例如。 Carbon除了其他事情之外,它將TListView的背景顏色更改爲灰色。獲取主題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
失敗並返回假。我使用了錯誤的參數嗎?或者我的方法錯了。
可能的參數可以在這裏找到:
TThemedListView
TElementColor
謝謝。
P.S .:我也看過this post但我的答案並沒有幫助到目前爲止。
謝謝!這似乎工作。將做更多的檢查並儘快接受 – torno