在自定义控件中禁用水平滚动条 [英] disable the horizontal scrollbar in custom control

查看:69
本文介绍了在自定义控件中禁用水平滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个自定义控件继承流布局panel.on控件我添加了按钮。并设置autoscroll = true,但我想禁用底部(水平)滚动条。如何做到这一点?

i crate one custom control inheriting the flow layout panel.on that control i added buttons.and set the autoscroll =true,but i want to disable the bottom(horizontal)scroll bar.how to do this?

推荐答案

您好,



您可以执行以下操作:



Hi,

you can do the following:

// need to disable AutoScroll, otherwise disabling the horizontal scrollbar doesn't work
flowLayoutPanel.AutoScroll = false;

// disable horizontal scrollbar
flowLayoutPanel.HorizontalScroll.Enabled = false;

// restore AutoScroll
flowLayoutPanel.AutoScroll = true;





希望这有帮助,



托马斯。



Hope this helps,

Thomas.


这篇关于在自定义控件中禁用水平滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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