Biblioteca de clases de .NET Framework
TableLayoutRowStyleCollection (Clase)
Actualización: noviembre 2007
Una colección que almacena objetos RowStyle.
Ensamblado: System.Windows.Forms (en System.Windows.Forms.dll)
Sintaxis
Visual Basic (Declaración)
Public Class TableLayoutRowStyleCollection _ Inherits TableLayoutStyleCollection
Visual Basic (Uso)
Dim instance As TableLayoutRowStyleCollection
C#
public class TableLayoutRowStyleCollection : TableLayoutStyleCollection
Visual C++
public ref class TableLayoutRowStyleCollection : public TableLayoutStyleCollection
J#
public class TableLayoutRowStyleCollection extends TableLayoutStyleCollection
JScript
public class TableLayoutRowStyleCollection extends TableLayoutStyleCollection
Comentarios
La clase TableLayoutRowStyleCollection representa la colección de todos los estilos utilizados para describir las filas de un TableLayoutPanel asociado.
Ejemplos
En el siguiente ejemplo se muestra cómo establecer RowStyle para un control TableLayoutRowStyleCollection. Este ejemplo de código forma parte de un ejemplo más extenso proporcionado para el control TableLayoutPanel.
Visual Basic
Private Sub toggleRowStylesBtn_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles toggleRowStylesBtn.Click Dim styles As TableLayoutRowStyleCollection = _ Me.TableLayoutPanel1.RowStyles For Each style As RowStyle In styles If style.SizeType = SizeType.Absolute Then style.SizeType = SizeType.AutoSize ElseIf style.SizeType = SizeType.AutoSize Then style.SizeType = SizeType.Percent ' Set the row height to be a percentage ' of the TableLayoutPanel control's height. style.Height = 33 Else ' Set the row height to 50 pixels. style.SizeType = SizeType.Absolute style.Height = 50 End If Next End Sub
C#
private void toggleRowStylesBtn_Click(
System.Object sender,
System.EventArgs e)
{
TableLayoutRowStyleCollection styles =
this.TableLayoutPanel1.RowStyles;
foreach( RowStyle style in styles )
{
if (style.SizeType==SizeType.Absolute)
{
style.SizeType = SizeType.AutoSize;
}
else if(style.SizeType==SizeType.AutoSize)
{
style.SizeType = SizeType.Percent;
// Set the row height to be a percentage
// of the TableLayoutPanel control's height.
style.Height = 33;
}
else
{
// Set the row height to 50 pixels.
style.SizeType = SizeType.Absolute;
style.Height = 50;
}
}
}
Jerarquía de herencia
System.Object
System.Windows.Forms.TableLayoutStyleCollection
System.Windows.Forms.TableLayoutRowStyleCollection
Seguridad para subprocesos
Todos los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.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.0Vea también