not showing on a panel with a black background when system colours are high-contrast)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41241
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
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;
}