* ComboBox.cs: page_size as well as vscrollbar.LargeChange should be 1
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>
Tue, 3 Jun 2008 06:26:51 +0000 (06:26 -0000)
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>
Tue, 3 Jun 2008 06:26:51 +0000 (06:26 -0000)
if needed, instead of 0 - this should help us in the corner case where
we have more than one item but we are only partially showing 1 item.
Fixes part of #374713.

2008-05-02  Carlos Alberto Cortez <calberto.cortez@gmail.com>

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

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

index dbc963bc04c2926307167911c94ad4949d58f82d..e68f0cf5e1a52e23482d0e96a9e764a6b6880298 100644 (file)
@@ -1,3 +1,10 @@
+2008-05-02  Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+       * ComboBox.cs: page_size as well as vscrollbar.LargeChange should be 1
+       if needed, instead of 0 - this should help us in the corner case where
+       we have more than one item but we are only partially showing 1 item.
+       Fixes part of #374713.
+
 2008-05-02  Carlos Alberto Cortez <calberto.cortez@gmail.com>
 
        * XplatUiX11.cs: When scrolling and detecting the obscured areas in a
index d2f17610b03c2d1b8f22f22dacbe64a4ebdd99f8..36a07edaa16737eb513e20cee7714d519d11d4fe 100644 (file)
@@ -2270,7 +2270,7 @@ namespace System.Windows.Forms
                                        }
                                }
                                
-                               page_size = height / owner.ItemHeight;
+                               page_size = Math.Max (height / owner.ItemHeight, 1);
 
                                ComboBoxStyle dropdown_style = owner.DropDownStyle;
                                if ((dropdown_style != ComboBoxStyle.Simple && owner.Items.Count <= owner.MaxDropDownItems)
@@ -2300,8 +2300,8 @@ namespace System.Windows.Forms
 #else
                                        int large = (dropdown_style == ComboBoxStyle.Simple ? page_size : owner.maxdrop_items) - 1;
 #endif
-                                       if (large < 0)
-                                               large = 0;
+                                       if (large < 1)
+                                               large = 1;
                                        vscrollbar_ctrl.LargeChange = large;
                                        show_scrollbar = vscrollbar_ctrl.Visible = true;