All pastes #31586 Raw Edit

Stuff

public text v1 · immutable
#31586 ·published 2005-11-28 20:47 UTC
rendered paste body
Index: System.Windows.Forms/MdiClient.cs
===================================================================
--- System.Windows.Forms/MdiClient.cs   (revision 53481)
+++ System.Windows.Forms/MdiClient.cs   (working copy)
@@ -202,6 +202,7 @@
                private void SizeScrollBars ()
                {
                        int right = 0;
+
                        foreach (Form child in Controls) {
                                if (!child.Visible)
                                        continue;
@@ -224,6 +225,7 @@
                        int prev_right_edge;
                        int prev_bottom_edge;
 
+int i = 0;
                        do {
 
                                prev_right_edge = right_edge;
@@ -237,6 +239,10 @@
                                        hbar.Visible = true;
                                        bottom_edge = Bottom - hbar.Height;
                                } else {
+                                       if (hbar == null) {
+                                               hbar = new HScrollBar ();
+                                               Controls.AddImplicit (hbar);
+                                       }
                                        hbar.Visible = false;
                                        bottom_edge = Bottom;
                                }
@@ -249,6 +255,10 @@
                                        vbar.Visible = true;
                                        right_edge = Right - vbar.Width;
                                } else {
+                                       if (vbar == null) {
+                                               vbar = new VScrollBar ();
+                                               Controls.AddImplicit (vbar);
+                                       }
                                        vbar.Visible = false;
                                        right_edge = Right;
                                }