]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/control.cpp
fixed wxOverlay to handle wxWindowDC/wxClientDC in the same way wxMac does
[wxWidgets.git] / src / msw / control.cpp
index 6572a219c03411fa3db236f43830b900a53a25ea..3797cab6254b1bd62a313e90091594657af4c23f 100644 (file)
@@ -196,7 +196,7 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
     }
 
     // set the size now if no initial size specified
-    SetInitialBestSize(size);
+    SetInitialSize(size);
 
     return true;
 }
@@ -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;
 }