DataGridViewCellStyle.Alignment DataGridViewCellStyle.Alignment DataGridViewCellStyle.Alignment DataGridViewCellStyle.Alignment Property

정의

DataGridView 셀에서 셀 내용의 위치를 나타내는 값을 가져오거나 설정합니다.Gets or sets a value indicating the position of the cell content within a DataGridView cell.

public:
 property System::Windows::Forms::DataGridViewContentAlignment Alignment { System::Windows::Forms::DataGridViewContentAlignment get(); void set(System::Windows::Forms::DataGridViewContentAlignment value); };
public System.Windows.Forms.DataGridViewContentAlignment Alignment { get; set; }
member this.Alignment : System.Windows.Forms.DataGridViewContentAlignment with get, set
Public Property Alignment As DataGridViewContentAlignment

속성 값

예외

예제

다음 코드 예제에서는이 속성의 사용을 보여 줍니다.The following code example illustrates the use of this property.

this.dataGridView1.Columns["CustomerName"].DefaultCellStyle
    .Alignment = DataGridViewContentAlignment.MiddleRight;
Me.dataGridView1.Columns("CustomerName").DefaultCellStyle _
    .Alignment = DataGridViewContentAlignment.MiddleRight

적용 대상

추가 정보