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);