3
我想获得TGroupBox标题的字体颜色,所以我可以将该颜色分配给TLabel。如何获取TGroupBox主题字体颜色
我想我需要使用GetThemeColor
,但我似乎无法弄清楚使用哪些参数?
更新 - 这是我使用基于答案代码:
function GetGroupBoxTextColor: TColor;
var
C: COLORREF;
ElementDetails: TThemedElementDetails;
begin
Result := clWindowText;
if ThemeServices.ThemesEnabled then
begin
ElementDetails := ThemeServices.GetElementDetails(tbGroupBoxNormal);
if GetThemeColor(ThemeServices.Theme[teButton], ElementDetails.Part, ElementDetails.State, TMT_TEXTCOLOR, C) = S_OK then
Result := C;
end;
end;
什么是'处理'指的是?表格? – ZigiZ
@ZigiZ,是的,它最有可能是表格句柄。 – TLama
为什么'试着...终于'? – OnTheFly