DataGridViewContentAlignment Enum
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.
Defines constants that indicate the alignment of content within a DataGridView cell.
public enum class DataGridViewContentAlignment
public enum DataGridViewContentAlignment
type DataGridViewContentAlignment =
Public Enum DataGridViewContentAlignment
- Inheritance
Fields
BottomCenter | 512 | The content is aligned vertically at the bottom and horizontally at the center of a cell. |
BottomLeft | 256 | The content is aligned vertically at the bottom and horizontally at the left of a cell. |
BottomRight | 1024 | The content is aligned vertically at the bottom and horizontally at the right of a cell. |
MiddleCenter | 32 | The content is aligned at the vertical and horizontal center of a cell. |
MiddleLeft | 16 | The content is aligned vertically at the middle and horizontally at the left of a cell. |
MiddleRight | 64 | The content is aligned vertically at the middle and horizontally at the right of a cell. |
NotSet | 0 | The alignment is not set. |
TopCenter | 2 | The content is aligned vertically at the top and horizontally at the center of a cell. |
TopLeft | 1 | The content is aligned vertically at the top and horizontally at the left of a cell. |
TopRight | 4 | The content is aligned vertically at the top and horizontally at the right of a cell. |
Examples
The following code example illustrates the use of this type. For more information, see How to: Format Data in the Windows Forms DataGridView Control.
this.dataGridView1.Columns["CustomerName"].DefaultCellStyle
.Alignment = DataGridViewContentAlignment.MiddleRight;
Me.dataGridView1.Columns("CustomerName").DefaultCellStyle _
.Alignment = DataGridViewContentAlignment.MiddleRight
Remarks
This enumeration is used by the DataGridViewCellStyle.Alignment property.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기