TableLayoutRowStyleCollection Classe
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Uma coleção que armazena RowStyle objetos.
public ref class TableLayoutRowStyleCollection : System::Windows::Forms::TableLayoutStyleCollection
public class TableLayoutRowStyleCollection : System.Windows.Forms.TableLayoutStyleCollection
type TableLayoutRowStyleCollection = class
inherit TableLayoutStyleCollection
Public Class TableLayoutRowStyleCollection
Inherits TableLayoutStyleCollection
- Herança
Exemplos
O exemplo seguinte mostra como definir RowStyle para um TableLayoutRowStyleCollection. Este exemplo de código faz parte de um exemplo maior fornecido para o TableLayoutPanel controlo.
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
Observações
A TableLayoutRowStyleCollection classe representa a coleção de todos os estilos usados para descrever as linhas num .TableLayoutPanel
Propriedades
| Name | Description |
|---|---|
| Count |
Obtém o número de estilos realmente contidos no TableLayoutStyleCollection. (Herdado de TableLayoutStyleCollection) |
| Item[Int32] |
Obtém ou define o RowStyle no índice especificado. |
Métodos
| Name | Description |
|---|---|
| Add(RowStyle) |
Adiciona um novo RowStyle ao TableLayoutRowStyleCollection. |
| Add(TableLayoutStyle) |
Adiciona um novo TableLayoutStyle ao final da coleção atual. (Herdado de TableLayoutStyleCollection) |
| Clear() |
Dissocia a coleção da sua associada TableLayoutPanel e esvazia a coleção. (Herdado de TableLayoutStyleCollection) |
| Contains(RowStyle) |
Determina se contém TableLayoutRowStyleCollection um estilo específico. |
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual. (Herdado de Object) |
| GetHashCode() |
Serve como função de hash predefinida. (Herdado de Object) |
| GetType() |
Obtém o Type da instância atual. (Herdado de Object) |
| IndexOf(RowStyle) |
Determina o índice de um item específico no TableLayoutRowStyleCollection. |
| Insert(Int32, RowStyle) |
Insere a RowStyle na TableLayoutRowStyleCollection posição especificada. |
| MemberwiseClone() |
Cria uma cópia superficial do atual Object. (Herdado de Object) |
| Remove(RowStyle) |
Remove a primeira ocorrência de um objeto específico do TableLayoutRowStyleCollection. |
| RemoveAt(Int32) |
Remove o estilo no índice especificado da coleção. (Herdado de TableLayoutStyleCollection) |
| ToString() |
Devolve uma cadeia que representa o objeto atual. (Herdado de Object) |
Implementações de Interface Explícita
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Para uma descrição deste método, veja o CopyTo(Array, Int32) método. (Herdado de TableLayoutStyleCollection) |
| ICollection.IsSynchronized |
Para uma descrição deste método, veja a IsSynchronized propriedade. (Herdado de TableLayoutStyleCollection) |
| ICollection.SyncRoot |
Para uma descrição deste método, veja a SyncRoot propriedade. (Herdado de TableLayoutStyleCollection) |
| IEnumerable.GetEnumerator() |
Para uma descrição deste método, veja o GetEnumerator() método. (Herdado de TableLayoutStyleCollection) |
| IList.Add(Object) |
Para uma descrição deste método, veja o Add(Object) método. (Herdado de TableLayoutStyleCollection) |
| IList.Contains(Object) |
Para uma descrição deste método, veja o Contains(Object) método. (Herdado de TableLayoutStyleCollection) |
| IList.IndexOf(Object) |
Para uma descrição deste método, veja o IndexOf(Object) método. (Herdado de TableLayoutStyleCollection) |
| IList.Insert(Int32, Object) |
Para uma descrição deste método, veja o Insert(Int32, Object) método. (Herdado de TableLayoutStyleCollection) |
| IList.IsFixedSize |
Para uma descrição deste método, veja a IsFixedSize propriedade. (Herdado de TableLayoutStyleCollection) |
| IList.IsReadOnly |
Para uma descrição deste método, veja a IsReadOnly propriedade. (Herdado de TableLayoutStyleCollection) |
| IList.Item[Int32] |
Para uma descrição deste método, veja a Item[Int32] propriedade. (Herdado de TableLayoutStyleCollection) |
| IList.Remove(Object) |
Para uma descrição deste método, veja o Remove(Object) método. (Herdado de TableLayoutStyleCollection) |
Métodos da Extensão
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Permite a paralelização de uma consulta. |
| AsQueryable(IEnumerable) |
Converte um IEnumerable para um IQueryable. |
| Cast<TResult>(IEnumerable) |
Conjura os elementos de an IEnumerable para o tipo especificado. |
| OfType<TResult>(IEnumerable) |
Filtra os elementos de um IEnumerable com base num tipo especificado. |