DataGridColumnStyle.Alignment Propriedade
Definição
Obtém ou define o alinhamento do texto em uma coluna.Gets or sets the alignment of text in a column.
public:
virtual property System::Windows::Forms::HorizontalAlignment Alignment { System::Windows::Forms::HorizontalAlignment get(); void set(System::Windows::Forms::HorizontalAlignment value); };
public virtual System.Windows.Forms.HorizontalAlignment Alignment { get; set; }
member this.Alignment : System.Windows.Forms.HorizontalAlignment with get, set
Public Overridable Property Alignment As HorizontalAlignment
Valor da propriedade
Um dos valores de HorizontalAlignment.One of the HorizontalAlignment values. O padrão é Left.The default is Left. As opções válidas incluem Left, Center e Right.Valid options include Left, Center, and Right.
Exemplos
O exemplo de código a seguir define a Alignment propriedade para cada coluna em um System.Windows.Forms.DataGrid para HorizontalAlignment.Center se os dados não forem uma cadeia de caracteres.The following code example sets the Alignment property for each column in a System.Windows.Forms.DataGrid to HorizontalAlignment.Center if the data isn't a string.
Private Sub SetAlign()
Dim myColumnStyle As DataGridColumnStyle
For each myColumnStyle In dataGrid1.TableStyles("Customers"). _
GridColumnStyles
myColumnStyle.Alignment = HorizontalAlignment.Center
Next
End Sub