隐藏Windows窗体的Horizo​​ntalScrollBar [英] Hide HorizontalScrollBar of a Windows Form

查看:59
本文介绍了隐藏Windows窗体的Horizo​​ntalScrollBar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如何隐藏Windows窗体的horizo​​ntalscroll属性

请帮忙

[后续问题:]

那么MDI表格呢...
如果将子窗体移到mdi窗体的角,则相应区域中会出现滚动条.
我们如何删除它...

Hi All,

How to hide the horizontalscroll property of a windows form

Please help

[Follow-up Question:]

What about the mdi form...
If the child forms are moved towards the corner of the mdi form then there is scroll bar in respective zones..
How can we remove it...

推荐答案

默认情况下,窗体没有水平滚动条:只有在启用AutoScroll属性的情况下,它才会出现至于面板.

如果确实启用了AutoScroll,则无法控制各个滚动条:它们在用户控件下显示和消失,具体取决于当前窗体的可见宽度.

如果您不希望使用水平滚动条,请使用每个控件的Anchor属性将其绑定到表单的右侧:然后,在调整表单大小时,控件将移动或调整大小,以便它们仍然适合,并且不会显示滚动条.
A form does not have a horizontal scroll bar by default: it will only appear if you enable the AutoScroll property - the same as for a Panel.

If you do enable AutoScroll, then you have no control over the individual scroll bars: they appear and disappear under the users control depending on the current visible width of the form.

If you don''t want a horizontal scroll bar, then use the Anchor property of each control to tie it to the right hand side of the form: Then as the form is resized, the controls will move or resize so that they still fit, and no scroll bar will be displayed.


请确保将AutoScroll属性设置为false.

之后,您可以使用HorizontalScrollVerticalScroll属性以及Scroll事件来设置自己的滚动逻辑.

关于MDI表单:我认为无法删除您正在谈论的滚动条.如果您不想使用滚动条,则必须使用不同于MDI表单的内容.只需保留父/子逻辑,但不将IsMdiContainer设置为true.
Make sure you set the AutoScroll property to false.

After that you can use the HorizontalScroll and VerticalScroll properties and Scroll event to set your own scrolling logic.

About MDI forms: I don''t think it is possible to remove the scroll bars you are talking about. If you don''t want scroll bars, then you have to use something different than MDI forms. Just keep the parent/child logic but without IsMdiContainer set to true.


这篇关于隐藏Windows窗体的Horizo​​ntalScrollBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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