+ // use the background colour override if a valid colour is given: this is
+ // used when the control is disabled to grey it out and also if colBg was
+ // set just above
+ if ( colBg.IsOk() )
+ {
+ wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBg);
+ hbr = (WXHBRUSH)brush->GetResourceHandle();
+ }
+
+ // always set the foreground colour if we changed the background, whether
+ // m_hasFgCol is true or not: if it true, we must do it, of course, but
+ // even if it isn't, we must set the default foreground explicitly as by
+ // default just the simple black is used
+ if ( hbr )
+ {
+ ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
+ }
+
+ // finally also set the background colour for text drawing: without this,
+ // the text in an edit control is drawn using the default background even
+ // if we return a valid brush
+ if ( colBg.IsOk() || m_hasBgCol )
+ {
+ if ( !colBg.IsOk() )
+ colBg = GetBackgroundColour();
+
+ ::SetBkColor(hdc, wxColourToRGB(colBg));
+ }
+
+ return hbr;
+}
+
+WXHBRUSH wxControl::MSWControlColor(WXHDC pDC, WXHWND hWnd)
+{
+ if ( HasTransparentBackground() )
+ ::SetBkMode((HDC)pDC, TRANSPARENT);