RowStyle Classe
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Representa a aparência de uma linha em um layout de tabela.
public ref class RowStyle : System::Windows::Forms::TableLayoutStyle
public class RowStyle : System.Windows.Forms.TableLayoutStyle
type RowStyle = class
inherit TableLayoutStyle
Public Class RowStyle
Inherits TableLayoutStyle
- Herança
Exemplos
O exemplo de código a seguir demonstra como extrair um RowStyle de um TableLayoutRowStyleCollection.
Este exemplo de código faz parte de um exemplo maior fornecido para a TableLayoutPanel classe.
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;
}
}
}
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
Comentários
A RowStyle classe representa as características da interface do usuário de uma linha em um TableLayoutPanel. Os estilos de todas as linhas em um TableLayoutPanel são coletados na TableLayoutPanel.RowStyles propriedade.
Essa classe simples oferece o Height e SizeType para uma linha.
Construtores
| Nome | Description |
|---|---|
| RowStyle() |
Inicializa uma instância da classe para seu RowStyle estado padrão. |
| RowStyle(SizeType, Single) |
Inicializa uma instância da RowStyle classe usando os valores de altura e fornecidos SizeType . |
| RowStyle(SizeType) |
Inicializa uma instância da RowStyle classe usando o valor fornecido SizeType . |
Propriedades
| Nome | Description |
|---|---|
| Height |
Obtém ou define a altura de uma linha. |
| SizeType |
Obtém ou define um sinalizador que indica como uma linha ou coluna deve ser dimensionada em relação à tabela que contém. (Herdado de TableLayoutStyle) |
Métodos
| Nome | Description |
|---|---|
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual. (Herdado de Object) |
| GetHashCode() |
Serve como a função de hash padrão. (Herdado de Object) |
| GetType() |
Obtém o Type da instância atual. (Herdado de Object) |
| MemberwiseClone() |
Cria uma cópia superficial do Objectatual. (Herdado de Object) |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual. (Herdado de Object) |