为什么我在工具条上得到一条垂直线? [英] Why am I getting a vertical line on toolstrip?

查看:147
本文介绍了为什么我在工具条上得到一条垂直线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个Windows窗体工具条,其中包含窗体上的一些控件。然而,由于一些奇怪的原因,他们在右手边包含一条垂直线。我找不到任何资源删除他们,我找不到任何其他信息,如何摆脱他们在线。

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.

任何人都可以帮助?提前感谢。

Can anyone help? Thanks in advance.

推荐答案

这是工具条的边框。需要在多个相邻的工具条之间进行清晰的分离。将其RenderMode属性更改为System将是一种方法来摆脱它,虽然这改变了外观和感觉。或者你可以写自己的渲染器来摆脱它。 C#示例:

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
        }
    }

这篇关于为什么我在工具条上得到一条垂直线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆