Просмотр исходного кода

2010-05-14 Carlos Alberto Cortez <[email protected]>

	* TabControl.cs: ItemSize should include the padding value.
	Update the retrieval of this info in SizeTab as well.
	Fixes part of #604034.


svn path=/trunk/mcs/; revision=157373
Carlos Alberto Cortez 15 лет назад
Родитель
Сommit
d86f8db4a5

+ 6 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

@@ -1,3 +1,9 @@
+2010-05-14  Carlos Alberto Cortez <[email protected]>
+
+	* TabControl.cs: ItemSize should include the padding value.
+	Update the retrieval of this info in SizeTab as well.
+	Fixes part of #604034.
+
 2010-05-11  Carlos Alberto Cortez <[email protected]>
 
 	* ScrollableControl.cs: It seems .Net is creating DockPadding lazyly,

+ 9 - 2
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs

@@ -231,7 +231,13 @@ namespace System.Windows.Forms {
 		[Localizable(true)]
 		public Size ItemSize {
 			get {
-				return item_size;
+				Size size = item_size;
+				if (SizeMode != TabSizeMode.Fixed) {
+					size.Width += padding.X;
+					size.Height += padding.Y;
+				}
+
+				return size;
 			}
 			set {
 				if (value.Height < 0 || value.Width < 0)
@@ -1276,7 +1282,8 @@ namespace System.Windows.Forms {
 				}
 			}
 
-			height = item_size.Height - ThemeEngine.Current.TabControlSelectedDelta.Height; // full height only for selected tab
+			// Use ItemSize property to recover the padding info as well.
+			height = ItemSize.Height - ThemeEngine.Current.TabControlSelectedDelta.Height; // full height only for selected tab
 
 			if (width < MinimumTabWidth)
 				width = MinimumTabWidth;