TableLayoutPanelGrowStyle (Enumeración) (System.Windows.Forms)

Cambiar vista:
Sin script
Biblioteca de clases de .NET Framework
TableLayoutPanelGrowStyle (Enumeración)

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.

Espacio de nombres:  System.Windows.Forms
Ensamblado:  System.Windows.Forms (en System.Windows.Forms.dll)
Sintaxis

Visual Basic (Declaración)
Public Enumeration TableLayoutPanelGrowStyle
Visual Basic (Uso)
Dim instance As TableLayoutPanelGrowStyle
C#
public enum TableLayoutPanelGrowStyle
Visual C++
public enum class TableLayoutPanelGrowStyle
J#
public enum TableLayoutPanelGrowStyle
JScript
public enum TableLayoutPanelGrowStyle
Miembros

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.
Comentarios

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.

Ejemplos

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.

Visual Basic
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


C#
    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);
        }
    }


Plataformas

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.
Información de versión

.NET Framework

Compatible con: 3.5, 3.0, 2.0
Vea también

Referencia