Ler en inglés

Compartir por


TableLayoutPanelGrowStyle Enumeración

Definición

Especifica cómo un objeto TableLayoutPanel incluirá filas o columnas adicionales después de que las celdas existentes estén llenas.

C#
public enum TableLayoutPanelGrowStyle
Herencia
TableLayoutPanelGrowStyle

Campos

Nombre Valor Description
AddColumns 2

El objeto TableLayoutPanel incluye columnas adicionales después de llenarse.

AddRows 1

El objeto TableLayoutPanel incluye filas adicionales después de llenarse.

FixedSize 0

El objeto TableLayoutPanel no permite la inclusión de filas o columnas adicionales después de llenarse.

Ejemplos

En el ejemplo siguiente se muestra cómo usar TableLayoutPanelGrowStyle para establecer la TableLayoutPanel.GrowStyle propiedad . Este ejemplo forma parte de un ejemplo más grande proporcionado para el TableLayoutPanel control .

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

Comentarios

Si se rellenan todas las celdas de y la GrowStyle propiedad se establece en TableLayoutPanel FixedSize, un intento de agregar otro control producirá una excepción.

Se aplica a

Produto Versións
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Consulte también