* ScrollableControl.cs: Lazy init the scrollbars.
authorJackson Harper <jackson@novell.com>
Thu, 6 Jan 2005 20:29:20 +0000 (20:29 -0000)
committerJackson Harper <jackson@novell.com>
Thu, 6 Jan 2005 20:29:20 +0000 (20:29 -0000)
svn path=/trunk/mcs/; revision=38462

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

index d3e1c2cfa58d705cd55ac5b8cfd3fe81ce12472d..994a7e55147c1b8248052820a08062c979d27a8e 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-06  Jackson Harper  <jackson@ximian.com>
+
+       * ScrollableControl.cs: Lazy init the scrollbars.
+
 2005-01-06  Jackson Harper  <jackson@ximian.com>
 
        * Theme.cs: Speed up getting pens and solid brushes, by using
index 268fdb805e277335f97307c04780c107b22c5da2..3aa3e614e8c100ea531cbd09627b0839dc71175f 100644 (file)
@@ -196,12 +196,6 @@ namespace System.Windows.Forms {
                        auto_scroll_min_size = new Size(0, 0);
                        auto_scroll_position = new Point(0, 0);
                        dock_padding = new DockPaddingEdges();
-
-                       hscrollbar = new ScrollBar();
-                       hscrollbar.Visible = false;
-
-                       vscrollbar = new ScrollBar();
-                       vscrollbar.Visible = false;
                }
                #endregion      // Public Constructors
 
@@ -323,6 +317,8 @@ namespace System.Windows.Forms {
                        set {
                                if (hscroll_visible != value) {
                                        hscroll_visible = value;
+                                       if (hscroll_visible && hscrollbar == null)
+                                               hscrollbar = new ScrollBar ();
                                }
                        }
                }
@@ -335,6 +331,8 @@ namespace System.Windows.Forms {
                        set {
                                if (vscroll_visible != value) {
                                        vscroll_visible = value;
+                                       if (vscroll_visible && vscrollbar == null)
+                                               vscrollbar = new ScrollBar ();
                                }
                        }
                }