Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table layout panel scroll bar

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 .

Thank you

like image 247
tom Avatar asked Jan 25 '11 13:01

tom


People also ask

What is a table layout panel?

A table layout panel is a container control for laying out other controls in a grid structure. The table layout panel automatically positions child controls in a grid. The grid structure is maintained when the control is resized.

What is the thing in the scroll bar called?

A vertical bar on the right side of a window or a horizontal bar at the bottom of a window that is used to move the window contents up and down or left and right. The bar contains a "thumb", which looks like an elevator in a shaft. When dragged with the mouse, the window contents move correspondingly.

Where is scroll bars located?

A vertical or horizontal bar commonly on the far right or bottom of a window that lets you move the window viewing area up, down, left, or right. Most people today are familiar with scroll bars because of the need to scroll up and down on almost every Internet web page.


1 Answers

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.

Procedure

  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.



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

like image 160
Alex Essilfie Avatar answered Sep 25 '22 11:09

Alex Essilfie