将滚动条放在Windows窗体上 [英] Putting a scroll bar on a Windows Form

查看:204
本文介绍了将滚动条放在Windows窗体上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我正在使用Visual Studio,制作一个Windows应用程序,并希望使其在侧面具有向下滚动整个表单的滚动条.我已经添加了垂直滚动条,但是不知道如何正确地将其附加到表单上.请帮忙.

到目前为止的代码:

Hi Im using Visual Studio, making a windows application and want to make it so at the side it has a scroll bar that scroll down the entire form. I have added the Vertical Scroll bar but dont know how to attach it to the form properly. Please help.

Code so far:

public frmNav()
{
    InitializeComponent();
}
private void btnOneToNine_Click(object sender, EventArgs e)
{
    Process.Start("frmOneToNine");
}
private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
{
}



如您所见,这里有一个按钮,基本上我希望表单上有许多按钮和标签,但需要更多空间,因此滚动条是必需的.



As you can see there is a button and basically I want many many buttons and labels on the form but need more room, so a scroll bar is a nessisary.

推荐答案

您可能不需要添加ScrollBar. Form具有一个AutoScroll属性,可以很好地处理大多数情况.
You may not need to add a ScrollBar. The Form has an AutoScroll property that handles most scenarios pretty well.


我希望这会对您有所帮助

C#中的垂直滚动条
[ ^ ]
I hope this will help you

Vertical ScrollBar in C#
[^]


这篇关于将滚动条放在Windows窗体上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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