表格布局面板滚动条 [英] Table layout panel scroll bar

查看:115
本文介绍了表格布局面板滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定一个具有2列和许多行的表布局面板,我如何为其附加滚动条,因为有时滚动条的增长远大于表单的大小.

given a table layout panel with 2 columns and many rows, how can i attatch a scroll bar to it as sometimes it grows much greater than the size of the form .

谢谢

推荐答案

TableLayoutPanel ScrollableControl .因此,您可以将其AutoScroll属性设置为True,并且当控件的首选大小超过其当前大小时,该控件将自动创建滚动条.这将为您提供所需的效果,而麻烦最少.

The TableLayoutPanel is an example of a ScrollableControl. You can therefore set it's AutoScroll property to True and the control will automatically create scroll bars when it's preferred size exceeds its current size. This will provide you with the desired effect with minimal hassle.

过程

  1. MaximumSize属性设置为首选的最大大小,或者可以将TableLayoutPanel停靠在窗体中.
  2. 将TableLayoutPanel的AutoScroll属性设置为true.
  1. Set the MaximumSize property to a preferred maximum size or you can dock the TableLayoutPanel in your form.
  2. Set the AutoScroll property of the TableLayoutPanel to true.



仅供参考:
Panel,ToolStrip,FlowLayoutPanel,SplitterPanel,TableLayoutPanel,TabPage和ToolStripContentPanel都继承ScrollableControl类,因此此答案也适用于它们.



FYI:
The Panel, ToolStrip, FlowLayoutPanel, SplitterPanel, TableLayoutPanel, TabPage and ToolStripContentPanel all inherit the ScrollableControl class so this answer applies to them as well.

这篇关于表格布局面板滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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