Author: joncham
Date: 2006-01-09 10:06:49 -0500 (Mon, 09 Jan 2006)
New Revision: 55224

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
Log:
2006-01-10  Jonathan Chambers  <[EMAIL PROTECTED]>

        * ComboBox.cs: Fix crash when there is no selected item (due to last 
commit)



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-01-09 14:20:27 UTC (rev 55223)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-01-09 15:06:49 UTC (rev 55224)
@@ -1,7 +1,11 @@
+2006-01-10  Jonathan Chambers  <[EMAIL PROTECTED]>
+
+       * ComboBox.cs: Fix crash when there is no selected item (due to last 
commit)
+
 2006-01-09  Jonathan Chambers  <[EMAIL PROTECTED]>
 
        * 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  <[EMAIL PROTECTED]>
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs      
2006-01-09 14:20:27 UTC (rev 55223)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs      
2006-01-09 15:06:49 UTC (rev 55224)
@@ -1961,7 +1961,8 @@
                                        return false;
                                        
                                SetHighLightedItem (owner.SelectedItem);
-                               SetTopItem (GetHighLightedIndex ());
+                               int index = GetHighLightedIndex ();
+                               SetTopItem (index == -1 ? 0 : index );
                                
                                CalcListBoxArea ();                             
                                Show ();

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to