Author: jackson
Date: 2007-04-03 13:14:00 -0400 (Tue, 03 Apr 2007)
New Revision: 75349

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
Log:

* TextBoxBase.cs: We need to calculate maximums even if this is
        not a multiline control, because the maxs are used for
scrolling.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-03 16:52:51 UTC (rev 75348)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-03 17:14:00 UTC (rev 75349)
@@ -1,3 +1,8 @@
+2007-04-03  Jackson Harper  <[EMAIL PROTECTED]>
+
+       * TextBoxBase.cs: We need to calculate maximums even if this is
+       not a multiline control, because the maxs are used for scrolling.
+
 2007-04-03  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * ToolBar.cs: Fix some breakage caused by the SetBoundsCore change.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2007-04-03 16:52:51 UTC (rev 75348)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2007-04-03 17:14:00 UTC (rev 75349)
@@ -1643,15 +1643,13 @@
                internal void CalculateScrollBars () {
                        // FIXME - need separate calculations for center and 
right alignment
 
-                       if (!document.multiline) {
-                               PositionControls ();
-                               return;
-                       }
+                       //      
 
                        if (document.Width >= document.ViewPortWidth) {
                                hscroll.SetValues (0, Math.Max (1, 
document.Width), -1,
                                                document.ViewPortWidth < 0 ? 0 
: document.ViewPortWidth);
-                               hscroll.Enabled = true;
+                               if (document.multiline)
+                                       hscroll.Enabled = true;
                        } else {
                                hscroll.Enabled = false;
                                hscroll.Maximum = document.ViewPortWidth;
@@ -1660,13 +1658,13 @@
                        if (document.Height >= document.ViewPortHeight) {
                                vscroll.SetValues (0, Math.Max (1, 
document.Height), -1,
                                                document.ViewPortHeight < 0 ? 0 
: document.ViewPortHeight);
-                               vscroll.Enabled = true;
+                               if (document.multiline)
+                                       vscroll.Enabled = true;
                        } else {
                                vscroll.Enabled = false;
                                vscroll.Maximum = document.ViewPortHeight;
                        }
 
-
                        if (!WordWrap) {
                                if ((scrollbars & 
RichTextBoxScrollBars.Horizontal) != 0) {
                                        if (((scrollbars & 
RichTextBoxScrollBars.ForcedHorizontal) != 0) || hscroll.Enabled) {

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

Reply via email to