Fixed bug where using ResXResourceWriter filename ctor caused corrupted output
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ToolStripDropDownButton.cs
index b578689192c8075775af8e51b29a0b37cf020082..a87798ce2068fb31a423b9c1043ea288394082c1 100644 (file)
@@ -26,7 +26,6 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 using System.Drawing;
 using System.Runtime.InteropServices;
 using System.Windows.Forms.Design;
@@ -104,7 +103,9 @@ namespace System.Windows.Forms
                #region Protected Methods
                protected override ToolStripDropDown CreateDefaultDropDown ()
                {
-                       return base.CreateDefaultDropDown ();
+                       ToolStripDropDownMenu tsdd = new ToolStripDropDownMenu ();
+                       tsdd.OwnerItem = this;
+                       return tsdd;
                }
 
                protected override void OnMouseDown (MouseEventArgs e)
@@ -167,6 +168,17 @@ namespace System.Windows.Forms
                        return true;
                }
                #endregion
+
+               #region Internal Methods
+               internal override Size CalculatePreferredSize (Size constrainingSize)
+               {
+                       Size preferred_size = base.CalculatePreferredSize (constrainingSize);
+
+                       if (this.ShowDropDownArrow)
+                               preferred_size.Width += 9;
+
+                       return preferred_size;
+               }
+               #endregion
        }
 }
-#endif