Create a SystemRenderer
:
public class MyToolStripSystemRenderer : ToolStripSystemRenderer
{
public MyToolStripSystemRenderer() { }
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
{
//Making this non-op removes the artifact line that is typically drawn on the bottom edge
//base.OnRenderToolStripBorder(e);
}
}
..and then make use of it in your ToolStrip
class in its constructor:
public MyToolStrip()
{
Renderer = new MyToolStripSystemRenderer();
}
If this isn't an inherited ToolStrip
control, but instead a stock control from Designer, then look in the Designer.cs
file for the lines that set ToolStrip properties. In mine it looks like this:
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(678, 25);
this.toolStrip1.TabIndex = 10;
this.toolStrip1.Text = "toolStrip1";
Add to that, this line:
this.toolStrip1.Renderer = new MyToolStripSystemRenderer();
**Note that you could add that same line to the form's constructor if you like. Same effect.