如何使Winform在C#中可滚动 [英] How to make Winform scrollable in C#

查看:508
本文介绍了如何使Winform在C#中可滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了具有以下优点的(我正在使用Visual Studio 2012)winform:

I have create (I am using Visual Studio 2012) winform that have this proprities:

  • 宽度:812
  • 高度:667
  • FormBorderStyle:固定3D

在放置vScrollBar的右侧(高度:599px,恰好是我固定形式的大小).现在,我希望表单高度可以达到667px,然后在滚动条的帮助下滚动到表单底部.让我把它放在图片中:

In right side of put vScrollBar (that have height: 599px, which is exactly the size in my fixed form). Now I whant that my form height would be heigher then 667px, and with help of scrollbar, you scroll to bottom of form. Let me put it in picture:

现在,我想创建如果您使用滚动条滚动文本框,等等向下移动,那么您可以看到当前隐藏的文本框(它们处于表单下方).

Now I whant to create If you scroll with scroll bar textboxs and etc. moves down, so you can see textboxes that are at the moment hidden (they are down of form).

到目前为止,我还没有任何代码.

So far I do not have any code.

有没有可以帮助我的教程.非常感谢您的帮助.

Is there any tutorial that could help me. Realy thanks for help.

推荐答案

您可以添加FlowLayoutPanel并将这些属性设置为:

You can add a FlowLayoutPanel and set the these properties to that:

 flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
 flowLayoutPanel1.WrapContents = false;
 flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
 flowLayoutPanel1.AutoScroll = true;

您可以看到滚动条,可以使用Panel s并设计您的应用程序.

and you can see the scroll, you can use the Panels and design your application.

或者完全不同,您可以设置this.AutoSize = true;并将一个控件拖到窗体的外部(大小不一),然后可以看到窗体的滚动条.

Or completely different, You can set the this.AutoSize = true; and drag one control to outer of form(big and small the size) and then, you can see the scrollBar of form.

这篇关于如何使Winform在C#中可滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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