Explorar el Código

2007-03-27 Mike Kestner <[email protected]>

	* ListBox.cs : don't adjust top item when SelectedIndex is set to -1.
	[Fixes #80428]

svn path=/trunk/mcs/; revision=75022
Mike Kestner hace 19 años
padre
commit
080d23ee66

+ 5 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

@@ -1,3 +1,8 @@
+2007-03-27  Mike Kestner  <[email protected]>
+
+	* ListBox.cs : don't adjust top item when SelectedIndex is set to -1.
+	[Fixes #80428]
+
 2007-03-26  Everaldo Canuto  <[email protected]>
 
 	* XplatUIWin32.cs: Complete NOTIFYICONDATA structure, additional fields 

+ 1 - 2
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs

@@ -444,8 +444,7 @@ namespace System.Windows.Forms
 				else if (SelectionMode == SelectionMode.One)
 					UnSelectItem (selected_index, true);
 
-    				if (value < top_index)
-    				{
+    				if (value != -1 && value < top_index) {
     					top_index = value;
     					UpdateTopItem ();
     				} else {

+ 0 - 1
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/CheckedListBoxTest.cs

@@ -378,7 +378,6 @@ namespace MonoTests.System.Windows.Forms
 #endif
 
 		[Test]
-		[NUnit.Framework.Category ("NotWorking")]
 		public void Text_SelectionMode_One ()
 		{
 			MockItem itemA = new MockItem ("A1", 1);