删除 BindingNavigator 上的下划线
当我将 BindingNavigator 添加到表单时,它的下方会显示一行。我怎样才能摆脱那条线?
我已经查看了属性中的所有设置,但我不知道如何摆脱它线。我也在网上查了一下,但找不到任何东西,但我不是唯一想删除它的人。有什么建议吗?
When I add a BindingNavigator to my forms it has a line that appears under it. How can I get rid of that line?
I have looked through all of the settings in the properties but I cannot tell how I can get rid of that line. I have also looked online and can't find anything, but I cannot be the only person who wants to remove this. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果不实现子类并覆盖 OnPaint 或执行其他一些替换或修改内置渲染的黑客操作,您可能无法做到这一点。这种方法的问题在于 BindingNavigator 可能是一个复合控件,这意味着有一堆按钮控件和一个文本框控件等,它们都自行处理一部分渲染。完全依靠您自己来呈现控件是很困难的。
You probably can't without implementing a subclass and overriding the
OnPaint
, or doing some other hack where you're replacing or modifying the built in rendering. The problem with this approach is that the BindingNavigator is probably a composite control, meaning there are a bunch of button controls, and a text box control, etc. that all handle a portion of the rendering themselves. It would be difficult to render the control entirely on your own.您可以尝试创建自己的渲染器,在其中省略渲染边框:
然后从代码中,您可以将其应用到导航器:
不幸的是,我认为此方法也可能隐藏分隔线。
You can try creating your own renderer where you omit the border from being rendered:
then from code, you can apply it to your navigator:
Unfortunately, I think this method might hide the separator lines, too.