From: Robin Dunn Date: Wed, 27 Oct 2004 00:56:50 +0000 (+0000) Subject: Ensire that m_value is updated when SetSelection is called X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1b135c93edeadeb3b8ba636e7e03bfe2f4a0b7de Ensire that m_value is updated when SetSelection is called git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 5cd1e71bed..49344341f1 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -254,6 +254,15 @@ WXLRESULT wxComboBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara UnpackCtlColor(wParam, lParam, &nCtlColor, &hdc, &hwnd); return (WXLRESULT)OnCtlColor(hdc, hwnd, nCtlColor, nMsg, wParam, lParam); + + case CB_SETCURSEL: + // Selection was set with SetSelection. Update the value too. + if (wParam < 0 || wParam > GetCount()) + m_value = wxEmptyString; + else + m_value = GetString(wParam); + break; + } return wxChoice::MSWWindowProc(nMsg, wParam, lParam);