title: ToolStrip Rounded Corners
body: <p>I am working on a Windows Form app (C#, .NET 4.0, VS 2010), where I have a pretty standard MainForm with a ToolStrip (GripStyle: Hidden, Dock: Top, RenderMode: ManagerRenderMode). The toolstrip contains a few basic items (ToolStripLabel, ToolStripSeparator, ToolStripSplitButton).</p>
  
  <p>This is rendered as follows:</p>
  
  <p><img src="https://i.stack.imgur.com/HRvVx.png" alt="ToolStrip rendered by default ManagerRenderMode"></p>
  
  <p>At first I simply wanted to add a 'bottom' border below the toolstrip, but I also noticed that this toolstrip is rendered with 'rounded corners' (you can see the right-hand-side top and bottom ones in the image), and a vertical gradient line.</p>
  
  <p><strong>How can I make these corners NOT rounded?</strong></p>
  
  <p>I tried:</p>
  
  <pre><code>public class MainFormToolStripRenderer : ToolStripProfessionalRenderer
  {
      protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
      {
          base.OnRenderToolStripBorder(e);
  
          var y = e.ToolStrip.Height-1;
          e.Graphics.DrawLine(new Pen(SystemColors.ControlDark, 1), new Point(0, y), new Point(e.ToolStrip.Width, y));
      }
  </code></pre>
  
  <p>And wired it up via <code>this.toolStrip_Actions.Renderer=new MainFormToolStripRenderer();</code> in my form initialization.</p>
  
  <p>This gave me the bottom border, but didn't do anything for the rounded corners. Also, with the added bottom border, the rounded corners are more noticeable:</p>
  
  <p><img src="https://i.stack.imgur.com/nn0Lf.png" alt="ToolStrip rendered by custom ToolStripProfessionalRenderer"></p>
  
  <p>Next I tried drawing a rectangle during the same event handler above, to try (at least) to hide the rounded corners and vertical gradient behind a solid rectangular border. That didn't work because the available drawing area (e.AffectedBounds) is within the rounded borders.</p>
  
  <p>I also tried to set the ToolStrip's RenderMode to System (and not use my renderer). In this case the toolstrip corners seem to fit snugly (rectangular), BUT the splitbutton within the toolbar seems to be broken (clicking the down arrow does not display the dropdown), for as-yet-unknown reasons, and the overall look-n-feel is a bit underwhelming (quite flat, until you hover on some buttons in the toolstrip).</p>
  
  <p>I guess in the end I'd rather stick with the ManageeRenderedMode, or a custom renderer inheriting from the Professional one - but I need to get rid of the rounded corners.
  Among others, I found <a href="https://stackoverflow.com/q/8527585/27826">this SO Q</a> which seems to point close to what I'm looking at but didn't give me an answer for my case.</p>
  
  <p>Thanks in advance</p>