X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/57bd4c6031d438f11af0ec540136f49a928b923c..ccb5db57cdb1766eefb7023dda50ede9f0d01f78:/src/msw/control.cpp diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 6572a219c0..9817456107 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -382,14 +382,15 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd) hbr = (WXHBRUSH)brush->GetResourceHandle(); - // if we use custom background, we should set foreground ourselves too - if ( !m_hasFgCol ) - { - ::SetTextColor(hdc, ::GetSysColor(COLOR_WINDOWTEXT)); - } - //else: already set above } + // if we use custom background, we should set foreground ourselves too + if ( hbr && !m_hasFgCol ) + { + ::SetTextColor(hdc, ::GetSysColor(COLOR_WINDOWTEXT)); + } + //else: already set above + return hbr; }