Merge pull request #951 from ermshiperete/bug-xamarin-2462
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ComboBox.cs
index 71a0d884676655a1a841379a8795671428cd2435..14345a6a491f8feb2916a136d7de9ee7dd285108 100644 (file)
@@ -2533,12 +2533,14 @@ namespace System.Windows.Forms
                                                vscrollbar_ctrl.Value = hli;
                                        }
                                }
-                               
-                               Size = new Size (width, height);
-                               textarea_drawable = ClientRectangle;
-                               textarea_drawable.Width = width;
-                               textarea_drawable.Height = height;
-                               
+
+                               var borderWidth = Hwnd.GetBorderWidth (CreateParams);
+                               var borderAdjustment = dropdown_style == ComboBoxStyle.Simple ? new Size (0, 0) :
+                                       new Size (borderWidth.top + borderWidth.bottom, borderWidth.left + borderWidth.right);
+                               Size = new Size (width, height + borderAdjustment.Height);
+                               textarea_drawable = new Rectangle (ClientRectangle.Location,
+                                       new Size (width - borderAdjustment.Width, height));
+
                                if (vscrollbar_ctrl != null && show_scrollbar)
                                        textarea_drawable.Width -= vscrollbar_ctrl.Width;