Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The TableLayoutPanel control arranges its contents in a grid. Because the layout is performed both at design time and run time, it can change dynamically as the application environment changes. This gives the controls in the panel the ability to proportionally resize, so they can respond to changes such as the parent control resizing or text length changing due to localization.
Any Windows Forms control can be a child of the TableLayoutPanel control, including other instances of TableLayoutPanel. This allows you to construct sophisticated layouts that adapt to changes at run time. However, only a single control can exist in a cell. If you want more than one control in a cell, you must group the controls in a UserControl
or another layout control such as Panel
orTableLayoutPanel
.
The TableLayoutPanel control can expand to accommodate new controls when they are added, depending on the value of the RowCount, ColumnCount, and GrowStyle properties. Setting either the RowCount or ColumnCount property to a value of 0 specifies that the TableLayoutPanel will be unbound in the corresponding direction.
You can also control the direction of expansion (horizontal or vertical) after the TableLayoutPanel control is full of child controls. By default, the TableLayoutPanel control expands downward by adding rows.
If you want rows and columns that behave differently from the default behavior, you can control the properties of rows and columns by using the RowStyles and ColumnStyles properties. You can set the properties of rows or columns individually.
The TableLayoutPanel control adds the following properties to its child controls: Cell
, Column
, Row
, ColumnSpan
, and RowSpan
.
You can merge cells in the TableLayoutPanel control by setting the ColumnSpan
or RowSpan
properties on a child control.
.NET Desktop feedback feedback
.NET Desktop feedback is an open source project. Select a link to provide feedback:
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Customize layout in .NET MAUI XAML pages - Training
Create consistent user interfaces across different devices by using StackLayout and Grid.