Kaynağa Gözat

Remove superflous call to CalcTabRows

svn path=/trunk/mcs/; revision=35716
Jackson Harper 21 yıl önce
ebeveyn
işleme
01535fb8e2

+ 6 - 3
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs

@@ -629,10 +629,13 @@ namespace System.Windows.Forms {
 						"Only TabPages can be directly added to TabControls.");
 				
 				base.Add (value);
-				if (Count == 1)
+				if (Count == 1) {
 					owner.SelectedIndex = 0;
-				owner.CalcTabRows (owner.Width);
-				
+				} else {
+					// Setting the selected index will calc the tab rows so
+					// we don't need to do it again
+					owner.CalcTabRows (owner.Width);
+				}
 			}
 		}