TableLayoutPanel::GrowStyle Property

 

Gets or sets a value indicating whether the TableLayoutPanel control should expand to accommodate new cells when all existing cells are occupied.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
property TableLayoutPanelGrowStyle GrowStyle {
	TableLayoutPanelGrowStyle get();
	void set(TableLayoutPanelGrowStyle value);
}

Property Value

Type: System.Windows.Forms::TableLayoutPanelGrowStyle

A TableLayoutPanelGrowStyle indicating the growth scheme. The default is AddRows.

Exception Condition
ArgumentException

The property value is invalid for the TableLayoutPanelGrowStyle enumeration.

By default, the TableLayoutPanel control expands downward by adding rows.

System_CAPS_noteNote

If an attempt is made to add a control to a full TableLayoutPanel control, and the value of GrowStyle is FixedSize, then an ArgumentException is thrown.

The following code example sets the value of the GrowStyle property depending on the selected RadioButton. At run time, when the user clicks on the button labeled Test GrowStyle, a Button control is added to the TableLayoutPanel control. If the TableLayoutPanel control is full, it expands by adding a row or column, or it raises an exception, depending on the value of GrowStyle.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: