X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a24fb9f847872e6ab2edf4be3e258245cbd8f20c..09e7316547fadf0998abd9eade215db7845538dd:/src/msw/choice.cpp diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 650dff48ce..0c0dbc10c7 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -646,6 +646,19 @@ void wxChoice::MSWDoPopupOrDismiss(bool show) ::SendMessage(GetHwnd(), CB_SHOWDROPDOWN, show, 0); } +bool wxChoice::Show(bool show) +{ + if ( !wxChoiceBase::Show(show) ) + return false; + + // When hiding the combobox, we also need to hide its popup part as it + // doesn't happen automatically. + if ( !show && ::SendMessage(GetHwnd(), CB_GETDROPPEDSTATE, 0, 0) ) + MSWDoPopupOrDismiss(false); + + return true; +} + // ---------------------------------------------------------------------------- // MSW message handlers // ----------------------------------------------------------------------------