]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combobox.cpp
Catching up to latest thread changes
[wxWidgets.git] / src / msw / combobox.cpp
index 9edc9f41459a070d50957deb9536ab354e13e1f5..0593b9342e9d804ce2ce2af40e1f41fc0b5a533d 100644 (file)
@@ -38,11 +38,14 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
 {
   if (param == CBN_SELCHANGE)
   {
-    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);
+    }
 
     return TRUE;
   }