简体   繁体   English

面板的C#滚动条? 用于一堆控件

[英]c# scroll bar for a panel? for bunch of controls

More of an info question, i have a panel on the left of my form that contains label, textboxs combos etc etc, but i need to create even more on the same page (not a sepereate form etc)there is basically no space left. 更多信息问题,我在表单的左侧有一个面板,其中包含标签,文本框组合等,但我需要在同一页面上创建更多面板(而不是单独的表单等),基本上没有剩余空间。 So im thinking of adding a scroll bar to the panel(if possible) this will enable the user to scroll up and down looking at the data break down of a multi series graph. 因此,我想在面板上添加滚动条(如果可能),这将使用户能够上下滚动查看多序列图的数据细分。 So in short do i: 简而言之,我:

  • Create a panel and attach a scroll bar control(if such a thing exists)? 创建面板并附加滚动条控件(如果存在此类控件)?
  • Create a new control that already has an in-built scroll bar? 创建一个已经具有内置滚动条的新控件?
  • non of these ideas, something better or easier? 没有这些想法,是更好还是更容易?

This is a design question more than anything.... and i will admit....im terrible at design, and im pretty new to winforms and all of its controls. 这是一个设计问题,比什么都重要。...我会承认....在设计上非常糟糕,对winforms及其所有控件来说都是新手。

heres a pic! 这是一张照片!

在此处输入图片说明

Any input would be great! 任何输入都会很棒! Many Thanks in Advance! 提前谢谢了!

The AutoScroll property can do this for you. AutoScroll属性可以为您完成此操作。 Just set it to True on the panel. 只需在面板上将其设置为True。 Then place the controls so that they extend beyond the edge of the panel, and a scroll bar will appear. 然后放置控件,使其延伸到面板边缘之外,并出现滚动条。

It might be easier to layout the controls first while the panel is bigger, then shrink the panel afterward when they're all in the correct positions. 当面板更大时,先布置控件可能会更容易,然后在它们都处于正确位置时再缩小面板。

There are many ways you can solve your issue. 您可以通过多种方式解决问题。

The first thing you could do is set your panel AutoScroll attribute to true 您可以做的第一件事是将面板的AutoScroll属性设置为true

If you have different sections, tab control is definatly a good idea. 如果您有不同的部分,则制表符控制绝对是个好主意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM