TableLayoutPanelGrowStyle Enumeración
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Especifica cómo un objeto TableLayoutPanel incluirá filas o columnas adicionales después de que las celdas existentes estén llenas.
public enum class TableLayoutPanelGrowStyle
public enum TableLayoutPanelGrowStyle
type TableLayoutPanelGrowStyle =
Public Enum TableLayoutPanelGrowStyle
- Herencia
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. |
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 .
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);
}
}
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
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.
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 |
Comentarios de .NET
.NET é un proxecto de código aberto. Selecciona unha ligazón para ofrecer comentarios: