* TextBoxBase.cs: We need to calculate maximums even if this is
authorJackson Harper <jackson@novell.com>
Tue, 3 Apr 2007 17:14:00 +0000 (17:14 -0000)
committerJackson Harper <jackson@novell.com>
Tue, 3 Apr 2007 17:14:00 +0000 (17:14 -0000)
        not a multiline control, because the maxs are used for
scrolling.

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

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

index 8b8588e4472433dbd35aeb0379bed7a253bfed50..5c32d294ab76a92d95304f0bf14dcd00e694faf0 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-03  Jackson Harper  <jackson@ximian.com>
+
+       * 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  <monkey@jpobst.com>
 
        * ToolBar.cs: Fix some breakage caused by the SetBoundsCore change.
index 793e33e1c340f6b4aba4c5989666c60d2ac14e34..70c2b5457a20f6d1d5e60d9a1d4976975920f512 100644 (file)
@@ -1643,15 +1643,13 @@ namespace System.Windows.Forms {
                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 @@ namespace System.Windows.Forms {
                        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) {