X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e255b00ced5114d9b599cd66cd9d737686cec94..489f6cf713b6b5bd9746af238b260c7d13d1dc40:/src/msw/stattext.cpp?ds=inline diff --git a/src/msw/stattext.cpp b/src/msw/stattext.cpp index 518a7677fd..466fb5484d 100644 --- a/src/msw/stattext.cpp +++ b/src/msw/stattext.cpp @@ -135,6 +135,14 @@ WXHBRUSH wxStaticText::DoMSWControlColor(WXHDC pDC, wxColour colBg) if (!hbr && m_hasFgCol) { hbr = MSWGetBgBrushForChild(pDC, this); + if (!hbr) + { + HDC hdc = (HDC)pDC; + wxColour bg = GetBackgroundColour(); + ::SetBkColor(hdc, wxColourToRGB(bg)); + wxBrush *brush = wxTheBrushList->FindOrCreateBrush(bg, wxSOLID); + hbr = (WXHBRUSH)brush->GetResourceHandle(); + } } return hbr; }