DataGridColumnStyle.Alignment Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Property Value
One of the HorizontalAlignment values. The default is Left
. Valid options include Left
, Center
, and Right
.
Examples
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
Applies to
Συνεργαστείτε μαζί μας στο GitHub
Μπορείτε να βρείτε την πηγή για αυτό το περιεχόμενο στο GitHub, όπου μπορείτε επίσης να δημιουργήσετε και να εξετάσετε ζητήματα και αιτήματα έλξης. Για περισσότερες πληροφορίες, ανατρέξτε στον οδηγό συνεργατών.