c#:如何确定当前是否显示Scrollable控件的ScrollBar? [英] c#: How do I determine if the ScrollBar for a Scrollable control is currently displayed?

查看:477
本文介绍了c#:如何确定当前是否显示Scrollable控件的ScrollBar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法为我检查了控制滚动条当前显示或不?我想用它,所以我可以决定如何大小滚动控制,这一定程度上取决于是否显示滚动条(滚动控制,可动态调整)。


的孩子< DIV CLASS =h2_lin>解决方案

有关使用AutoScroll属性控制尝试Horizo​​ntalScroll和VerticalScroll Visible属性:

  //检查水平滚动条visibity。 
yourScrollableControl.Horizo​​ntalScroll.Visible;

//检查水平滚动条visibity。
yourScrollableControl.VerticalScroll.Visible;


Is there a way for me to check if the Scrollbar for a control is currently displayed or not? I want to use it so I can determine how to size the children of the Scrollable control, which is somewhat dependent on whether or not the ScrollBar is displayed (the Scrollable control can be dynamically resized).

解决方案

For controls with the AutoScroll property try the HorizontalScroll and VerticalScroll Visible properties:

// Checks horizontal scrollbar visibity.
yourScrollableControl.HorizontalScroll.Visible;

// Checks horizontal scrollbar visibity.
yourScrollableControl.VerticalScroll.Visible;

这篇关于c#:如何确定当前是否显示Scrollable控件的ScrollBar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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