- wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId);
- event.SetInt(GetSelection());
- event.SetEventObject(this);
- event.SetString(GetStringSelection());
- ProcessCommand(event);
+ if (GetSelection() > -1)
+ {
+ wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId);
+ event.SetInt(GetSelection());
+ event.SetEventObject(this);
+ event.SetString(GetStringSelection());
+ ProcessCommand(event);
+ }