添加自动滚动到具有多个按钮的窗口 [英] Add Auto Scroll to a window with multiple buttons

查看:136
本文介绍了添加自动滚动到具有多个按钮的窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个窗口,并添加了近50个按钮。但问题是我只能看到一些按钮,因为我的窗口没有向上/向下或向左/向右滚动以显示剩余的按钮。



如果我的窗口是一个编辑框,我可以轻松地将AutoScroll添加到它,即只要编辑窗口中的文本超出窗口上的可用区域,它就会开始滚动。但是这个功能只适用于编辑窗口。



如何将自动滚动功能添加到具有多个按钮的窗口(不是编辑窗口),即如果按钮数超过窗口上的可用空间,则必须开始自动滚动。

I have created a window and added almost 50 buttons to it. But the problem is that I can only see a few of those buttons as my window does not scroll up/down or left/right to show me the remaining buttons.

If my window is an edit box, I can easily add AutoScroll to it i.e. as soon as the text in edit window exceeds the available area on the window, it starts scrolling. But that functionlity is only for edit window.

How can I add such functionlity of Auto-Scroll to a window (which is not an Edit Window) with multiple buttons i.e. if number of buttons exceed the available space on window, it must start auto scrolling.

推荐答案

将您的按钮放入System.Windows.Forms.Panel并设置AutoScroll =这是更多信息:

使用Autoscroll属性自定义面板 [ ^ ]
put your buttons inside the System.Windows.Forms.Panel and set AutoScroll = true

more info here:
Customize a panel with Autoscroll property[^]


这篇关于添加自动滚动到具有多个按钮的窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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