X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/678cd6de66095373ebaed01d8d013f256cac326b..47f12f58dbd5e62c5d1c635142a26c3e2208d012:/src/msw/button.cpp diff --git a/src/msw/button.cpp b/src/msw/button.cpp index b1001d5930..e369bf170d 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -249,9 +249,20 @@ WXHBRUSH wxButton::OnCtlColor(WXHDC pDC, WXWPARAM wParam, WXLPARAM lParam) { - wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID); + const HDC& hdc = (HDC)pDC; - return (WXHBRUSH) backgroundBrush->GetResourceHandle(); + const wxColour& colBack = GetBackgroundColour(); + ::SetBkColor(hdc, RGB(colBack.Red(), colBack.Green(), colBack.Blue())); + + const wxColour& colFor = GetForegroundColour(); + ::SetTextColor(hdc, RGB(colFor.Red(), colFor.Green(), colFor.Blue())); + + ::SetBkMode(hdc, OPAQUE); + + wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(colBack, + wxSOLID); + backgroundBrush->RealizeResource(); + return (WXHBRUSH)backgroundBrush->GetResourceHandle(); } long wxButton::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)