diff --git a/docs/changes.txt b/docs/changes.txt index 1e3dc43585..7b7928a71d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -27,3 +27,4 @@ wxMSW: - Improve wxMimeTypesManager open command detection (Eric Jensen). - Make wxFILTER_INCLUDE_LIST in wxTextValidator actually usable. +- Fix handling of selected images in wxBitmapButton (Artur Wieczorek). diff --git a/src/msw/anybutton.cpp b/src/msw/anybutton.cpp index a930d3c11a..6a964f059d 100644 --- a/src/msw/anybutton.cpp +++ b/src/msw/anybutton.cpp @@ -1175,7 +1175,13 @@ bool wxAnyButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis) } } } - + else + { + // clear the background (and erase any previous bitmap) + COLORREF colBg = wxColourToRGB(GetBackgroundColour()); + AutoHBRUSH hbrushBackground(colBg); + FillRect(hdc, &rectBtn, hbrushBackground); + } // draw the image, if any if ( m_imageData )