X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/750040fabb4e91f3b7acb4edf7ce58fb600dbc0a..4508fcd20aa15964291b7c9def941b2a6dc55445:/src/univ/combobox.cpp?ds=sidebyside 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