diff --git a/lcl/interfaces/win32/win32wsstdctrls.pp b/lcl/interfaces/win32/win32wsstdctrls.pp index 2f4caf3ef7..6580ecb891 100644 --- a/lcl/interfaces/win32/win32wsstdctrls.pp +++ b/lcl/interfaces/win32/win32wsstdctrls.pp @@ -1388,6 +1388,7 @@ function StaticTextParentMsgHandler(const AWinControl: TWinControl; Window: HWnd var MsgResult: Windows.LResult; var WinProcess: Boolean): Boolean; var Info: PWin32WindowInfo; + TextColor: TColor; begin Result := False; case Msg of @@ -1398,9 +1399,13 @@ begin if Result then begin ThemeServices.DrawParentBackground(HWND(LParam), HDC(WParam), nil, False); - MsgResult := GetStockObject(HOLLOW_BRUSH); + MsgResult := Windows.GetStockObject(HOLLOW_BRUSH); WinProcess := False; - SetBkMode(HDC(WParam), TRANSPARENT); + Windows.SetBkMode(HDC(WParam), TRANSPARENT); + TextColor := Info^.WinControl.Font.Color; + if TextColor = clDefault then + TextColor := Info^.WinControl.GetDefaultColor(dctFont); + Windows.SetTextColor(HDC(WParam), ColorToRGB(TextColor)); end; end; end;