3

I have two Windows Forms toolstrips that contain some controls on a form. However, for some strange reason, they contain a vertical line on the right hand side. I cannot find any property to remove them and I cannot find any other information on how to get rid of them online.

Problem illustration

Can anyone help? Thanks in advance.

1 Answer 1

5

It's the border of the toolstrip. Meant to give a clear separation between multiple adjacent tool strips. Changing its RenderMode property to System would be one way to get rid of it, albeit that this changes the look-and-feel. Or you can write your own renderer to get rid of it. A C# example:

    public Form1() {
        InitializeComponent();
        toolStrip1.Renderer = new MyRenderer();
    }
    private class MyRenderer : ToolStripProfessionalRenderer {
        protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) {
            // Do nothing
        }
    }
1
  • It has been a feature for the past 9 years, it will be for the next 9. Changing it with a single line of code is not called "problem". May 29, 2014 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.