X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/750040fabb4e91f3b7acb4edf7ce58fb600dbc0a..65c11337559c3b95e86d38723c37ca6b10a2bd5b:/src/univ/combobox.cpp diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index febde2efc1..f347cfe1b9 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -389,8 +389,12 @@ void wxComboBox::SetSelection(int n) wxCHECK_RET( (n == wxNOT_FOUND || IsValid(n)), _T("invalid index in wxComboBox::Select") ); GetLBox()->SetSelection(n); - if ( GetTextCtrl() ) - GetTextCtrl()->SetValue(GetLBox()->GetString(n)); + + wxString str; + if ( n != wxNOT_FOUND ) + str = GetLBox()->GetString(n); + + SetText(str); } int wxComboBox::GetSelection() const