Actualización: noviembre 2007
Especifica cómo un objeto TableLayoutPanel incluirá filas o columnas adicionales después de que las celdas existentes estén llenas.
Ensamblado: System.Windows.Forms (en System.Windows.Forms.dll)
Public Enumeration TableLayoutPanelGrowStyle
Dim instance As TableLayoutPanelGrowStyle
public enum TableLayoutPanelGrowStyle
public enum class TableLayoutPanelGrowStyle
public enum TableLayoutPanelGrowStyle
public enum TableLayoutPanelGrowStyle
| Nombre de miembro | Descripción | |
|---|---|---|
| FixedSize | El objeto TableLayoutPanel no permite la inclusión de filas o columnas adicionales después de llenarse. | |
| AddRows | El objeto TableLayoutPanel incluye filas adicionales después de llenarse. | |
| AddColumns | El objeto TableLayoutPanel incluye columnas adicionales después de llenarse. |
Si todas las celdas del objeto TableLayoutPanel están llenas y la propiedad GrowStyle se establece en FixedSize, el intento de agregar otro control producirá una excepción.
En el ejemplo siguiente se muestra cómo utilizar TableLayoutPanelGrowStyle para establecer la propiedad GrowStyle en un control TableLayoutPanel. Este ejemplo de código forma parte de un ejemplo más extenso proporcionado para el control TableLayoutPanel.
Private Sub growStyleNoneBtn_CheckedChanged( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles growStyleNoneBtn.CheckedChanged Me.tlpGrowStyle = TableLayoutPanelGrowStyle.FixedSize End Sub Private Sub growStyleAddRowBtn_CheckedChanged( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles growStyleAddRowBtn.CheckedChanged Me.tlpGrowStyle = TableLayoutPanelGrowStyle.AddRows End Sub Private Sub growStyleAddColumnBtn_CheckedChanged( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles growStyleAddColumnBtn.CheckedChanged Me.tlpGrowStyle = TableLayoutPanelGrowStyle.AddColumns End Sub Private Sub testGrowStyleBtn_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles testGrowStyleBtn.Click Me.TableLayoutPanel1.GrowStyle = Me.tlpGrowStyle Try Me.TableLayoutPanel1.Controls.Add(New Button()) Catch ex As ArgumentException Trace.WriteLine(ex.Message) End Try End Sub
private void growStyleNoneBtn_CheckedChanged(
System.Object sender,
System.EventArgs e)
{
this.tlpGrowStyle = TableLayoutPanelGrowStyle.FixedSize;
}
private void growStyleAddRowBtn_CheckedChanged(
System.Object sender,
System.EventArgs e)
{
this.tlpGrowStyle = TableLayoutPanelGrowStyle.AddRows;
}
private void growStyleAddColumnBtn_CheckedChanged(
System.Object sender,
System.EventArgs e)
{
this.tlpGrowStyle = TableLayoutPanelGrowStyle.AddColumns;
}
private void testGrowStyleBtn_Click(
System.Object sender,
System.EventArgs e)
{
this.TableLayoutPanel1.GrowStyle = this.tlpGrowStyle;
try
{
this.TableLayoutPanel1.Controls.Add(new Button());
}
catch(ArgumentException ex)
{
Trace.WriteLine(ex.Message);
}
}
Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.