2006-01-10 Jonathan Chambers <jonathan.chambers@ansys.com>
authorJonathan Chambers <joncham@gmail.com>
Mon, 9 Jan 2006 15:06:49 +0000 (15:06 -0000)
committerJonathan Chambers <joncham@gmail.com>
Mon, 9 Jan 2006 15:06:49 +0000 (15:06 -0000)
* ComboBox.cs: Fix crash when there is no selected item (due to last commit)

svn path=/trunk/mcs/; revision=55224

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs

index 78e7089101560221bb5c00963d46d79fddca3335..df9ca28aa7917fa3c081d75a60d03082381f50fe 100644 (file)
@@ -1,7 +1,11 @@
+2006-01-10  Jonathan Chambers  <jonathan.chambers@ansys.com>
+
+       * ComboBox.cs: Fix crash when there is no selected item (due to last commit)
+
 2006-01-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
 
        * ComboBox.cs: Added KeyDown event handler for processing arrow keys
-       and PgUp/PgDown. Also, scroll to selected item upon dropdown.
+       and PgUp/PgDown. Also, scroll to selected item upon dropdown. Bugs 76857 and 76788.
 
 2006-01-08  Alexander Olk  <alex.olk@googlemail.com>
 
index ec65ece48df2801da6cb95ec010e83899e5490d4..3e887a2ef8f8a28f684b66a6718b26a400d8e8ca 100644 (file)
@@ -1961,7 +1961,8 @@ namespace System.Windows.Forms
                                        return false;
                                        
                                SetHighLightedItem (owner.SelectedItem);
-                               SetTopItem (GetHighLightedIndex ());
+                               int index = GetHighLightedIndex ();
+                               SetTopItem (index == -1 ? 0 : index );
                                
                                CalcListBoxArea ();                             
                                Show ();