![]() |
Accessories for Control Design: The Table Layout Panel |
Introduction
During your application design, if you have a group of controls that you want to align either horizontally or vertically, you can use the flow layout panel. You can use different rows and columns of flow layout panels to align the controls. If you do this, you would then have to align the flow layout panels also to make sure their controls are aligned.
In reality, the flow layout panel is a valuable accessory for control design but it may not effectively align different types of controls. To assist with another type of problem, you can use the table layout panel.
The table layout panel is represented in the .NET Framework by the TableLayoutPanel class and in the Toolbox by the TableLayoutPanel control. To use it at design time, from the Toolbox, click the TableLayoutPanel button and click the form. When it has been added, it presents a dotted table made of four cells:
To use the table layout panel as a design object, you can click a control from the Toolbox and click a cell in the table. The control would be added to that cell. To add another control to the application, you can click it from the Toolbox and click another cell:
Characteristics of a Table Layout
You cannot add a control to a cell if that cell contains a control already. If you want to add more controls than the cells in the table layout panel, you can add new cells. To do this, first select the table layout panel from the form:
Besides the ability to align the controls, the table layout panel provides various aesthetic characteristics, such as the background color of the table, various styles for the dividing lines of the cells, etc.
|
||
Home | Copyright © 2010-2022, FunctionX | |
|