Bläddra i källkod

2008-06-04 Carlos Alberto Cortez <[email protected]>

	* ComboBox.cs: If the combobox is anchored both on top and bottom,
	adjust height if IntegralHeight is true when calling SetBoundsCore (as
	likely the height was modified even if Height wasn't specified in
	BoundsSpecified parameter).
	Fixes part of #396297.


svn path=/trunk/mcs/; revision=104834
Carlos Alberto Cortez 17 år sedan
förälder
incheckning
c7678dbbbf

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

@@ -1,3 +1,11 @@
+2008-06-04  Carlos Alberto Cortez <[email protected]>
+
+	* ComboBox.cs: If the combobox is anchored both on top and bottom,
+	adjust height if IntegralHeight is true when calling SetBoundsCore (as
+	likely the height was modified even if Height wasn't specified in
+	BoundsSpecified parameter).
+	Fixes part of #396297.
+
 2008-06-04  George Giolfan  <[email protected]> 
 
 	* InternalWindowsManager.cs: Changed minimum window size while resizing to

+ 5 - 1
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs

@@ -1283,7 +1283,11 @@ namespace System.Windows.Forms
 
 		protected override void SetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified)
 		{
-			if ((specified & BoundsSpecified.Height) != 0) {
+			bool vertically_anchored = (Anchor & AnchorStyles.Top) != 0 && (Anchor & AnchorStyles.Bottom) != 0;
+
+			if ((specified & BoundsSpecified.Height) != 0 ||
+				(specified == BoundsSpecified.None && vertically_anchored)) {
+
 				requested_height = height;
 
 				if (DropDownStyle == ComboBoxStyle.Simple && height > PreferredHeight) {