Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleMake a form with a fixed-sized column between two other columns that share the remaining available space in Visual Basic .NET
DescriptionThis example shows how to make a form with a fixed-sized column between two other columns that share the remaining available space in Visual Basic .NET.
Keywordsform, columns, table, TableLayoutPanel, Visual Basic .NET, VB.NET
CategoriesControls
 
This example demonstrates a seldom-used control: TableLayoutPanel. Add a TableLayoutPanel to the form and dock it to fill the form.

Select the control and click the SmartTag on its upper right corner. (It looks like a little white square with a black triangle in it.) Use the Add Column, Add Row, Remove Last Column, and Remove Last Row commands to get the number of rows and columns you want. This example uses one row and three columns.

If the SmartTag is closed, open it again and select the "Edit Rows and Columns" command. Select the row or column you want to edit in the list on the left. Then use the controls on the right to set the item's size.

For this example, set these values:

ColumnSize TypeSize Value
Column1Percent50
Column2Absolute100
Column3Percent50

Now when the form resizes, the middle column remains 100 pixels wide and the other columns share the remaining available space. Use Dock, Anchor, and other properties to arrange the controls inside each of the TableLayoutPanel's cells.

 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated