Author: everaldo
Date: 2006-11-02 02:29:15 -0500 (Thu, 02 Nov 2006)
New Revision: 67255
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs
Log:
scroll visible area when change SelectedIndex
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-11-02 03:45:34 UTC (rev 67254)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-11-02 07:29:15 UTC (rev 67255)
@@ -1,3 +1,8 @@
+2006-11-02 Everaldo Canuto <[EMAIL PROTECTED]>
+
+ * ListBox.cs: scroll visible area when change SelectedIndex to
+ a non visible area. Fixes #79481.
+
2006-11-01 Jackson Harper <[EMAIL PROTECTED]>
* TextControl.cs: When replacing the selection move the selection
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs
2006-11-02 03:45:34 UTC (rev 67254)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs
2006-11-02 07:29:15 UTC (rev 67255)
@@ -416,6 +416,18 @@
else if (SelectionMode == SelectionMode.One)
UnSelectItem (selected_index, true);
+ if (value < top_index)
+ {
+ top_index = value;
+ UpdateTopItem ();
+ } else {
+ int rows = items_area.Height /
ItemHeight;
+ if (value >= (top_index + rows))
+ {
+ top_index = value - rows + 1;
+ UpdateTopItem ();
+ }
+ }
SelectItem (value);
selected_index = value;
FocusedItem = value;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches