diff --git a/docs/changes.txt b/docs/changes.txt index 5dde0cbb30..11a1fc9fcb 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -129,6 +129,7 @@ wxMac: wxUniv: - Fix wxTextCtrl::SetSelection(-1, -1) to behave as documented (Anders Larsen) +- Fix wxComboBox::SetSelection(wxNOT_FOUND) - Fix setting background colour for controls with transparent background diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index b615a9b537..f347cfe1b9 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -390,7 +390,11 @@ void wxComboBox::SetSelection(int n) GetLBox()->SetSelection(n); - SetText(GetLBox()->GetString(n)); + wxString str; + if ( n != wxNOT_FOUND ) + str = GetLBox()->GetString(n); + + SetText(str); } int wxComboBox::GetSelection() const