diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 077d09417b..aac7d19549 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -566,6 +566,9 @@ bool wxMSWOwnerDrawnButtonBase::MSWDrawButton(WXDRAWITEMSTRUCT *item) int flags = MSWGetButtonCheckedFlag(); + if ( dis->itemState & ODS_SELECTED ) + flags |= wxCONTROL_SELECTED | wxCONTROL_PRESSED; + if ( !m_win->IsEnabled() ) flags |= wxCONTROL_DISABLED; @@ -620,6 +623,9 @@ bool wxMSWOwnerDrawnButtonBase::MSWDrawButton(WXDRAWITEMSTRUCT *item) rectLabel.right = rect.right; } + // Erase the background. + ::FillRect(hdc, &rect, m_win->MSWGetBgBrush(hdc)); + // draw the button itself wxDCTemp dc(hdc);