Question

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.

Était-ce utile?

La solution

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
        }
    }
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top