Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações. |
Tradução
Original
|
Classe TableLayoutColumnStyleCollection
Uma coleção que armazena ColumnStyle objetos.
Assembly: System.Windows.Forms (em System.Windows.Forms.dll)
The TableLayoutColumnStyleCollection classe representa a coleção de todos os estilos usados para descrever as colunas de um associado TableLayoutPanel.
O exemplo a seguir mostra como conjunto ColumnStyle para um TableLayoutColumnStyleCollection. Este exemplo de código faz parte de um exemplo maior fornecido para o TableLayoutPanel controle.
privatevoid toggleColumnStylesBtn_Click(
System.Object sender,
System.EventArgs e)
{
TableLayoutColumnStyleCollection styles =
this.TableLayoutPanel1.ColumnStyles;
foreach( ColumnStyle style in styles )
{
if( style.SizeType == SizeType.Absolute )
{
style.SizeType = SizeType.AutoSize;
}
elseif( style.SizeType == SizeType.AutoSize )
{
style.SizeType = SizeType.Percent;
// Set the column width to be a percentage// of the TableLayoutPanel control's width.
style.Width = 33;
}
else
{
// Set the column width to 50 pixels.
style.SizeType = SizeType.Absolute;
style.Width = 50;
}
}
}
System.Object
System.Windows.Forms.TableLayoutStyleCollection
System.Windows.Forms.TableLayoutColumnStyleCollection
System.Windows.Forms.TableLayoutStyleCollection
System.Windows.Forms.TableLayoutColumnStyleCollection
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
o.NET Framework e.NET Compact Framework não oferecem suporte a todas as versões de cada plataforma. Para obter uma lista de versões suportadas, consulte Requisitos de sistema do .NET framework.
Conteúdo da Comunidade
Adicionar