如何禁用的WinForm C#在工具条线? [英] How to disable the line under tool strip in winform c#?

查看:166
本文介绍了如何禁用的WinForm C#在工具条线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这行?

推荐答案

这是在系统呈现了一个bug,在的这个bug报告

It's a bug in the "system" renderer, details in this bug report.

微软的回应给出了一个非常简单的解决方法:

Microsoft's response gives a very easy workaround:

1)创建的子类 ToolStripSystemRenderer ,覆盖 OnRenderToolStripBorder ,使它无操作:

1) Create a subclass of ToolStripSystemRenderer, overriding OnRenderToolStripBorder and making it a no-op:

public class MySR : ToolStripSystemRenderer
{
    public MySR() { }

    protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
    {
        //base.OnRenderToolStripBorder(e);
    }
}



2)使用的渲染你的工具条:

2) Use that renderer for your toolstrip:

toolStrip3.Renderer = new MySR();

这篇关于如何禁用的WinForm C#在工具条线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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