DataGridViewHeaderBorderStyle 枚举

定义

指定可以应用于 ColumnHeadersBorderStyle 控件的 RowHeadersBorderStyleDataGridView 属性的边框样式。Specifies the border style that can be applied to the ColumnHeadersBorderStyle and RowHeadersBorderStyle properties of a DataGridView control.

public enum class DataGridViewHeaderBorderStyle
public enum DataGridViewHeaderBorderStyle
type DataGridViewHeaderBorderStyle = 
Public Enum DataGridViewHeaderBorderStyle
继承
DataGridViewHeaderBorderStyle

字段

Custom 0

已经自定义的边框。A border that has been customized.

None 4

无边框。No borders.

Raised 2

三维凸起边框。A three-dimensional raised border.

Single 1

单行边框。A single-line border.

Sunken 3

三维凹陷边框。A three-dimensional sunken border.

示例

下面的代码示例演示如何使用此类型。The following code example illustrates the use of this type. 有关详细信息,请参阅如何:更改 Windows 窗体 DataGridView 控件中的边框和网格线样式。For more information, see How to: Change the Border and Gridline Styles in the Windows Forms DataGridView Control.

private void SetBorderAndGridlineStyles()
{
    this.dataGridView1.GridColor = Color.BlueViolet;
    this.dataGridView1.BorderStyle = BorderStyle.Fixed3D;
    this.dataGridView1.CellBorderStyle =
        DataGridViewCellBorderStyle.None;
    this.dataGridView1.RowHeadersBorderStyle =
        DataGridViewHeaderBorderStyle.Single;
    this.dataGridView1.ColumnHeadersBorderStyle =
        DataGridViewHeaderBorderStyle.Single;
}
Private Sub SetBorderAndGridlineStyles()

    With Me.dataGridView1
        .GridColor = Color.BlueViolet
        .BorderStyle = BorderStyle.Fixed3D
        .CellBorderStyle = DataGridViewCellBorderStyle.None
        .RowHeadersBorderStyle = _
            DataGridViewHeaderBorderStyle.Single
        .ColumnHeadersBorderStyle = _
            DataGridViewHeaderBorderStyle.Single
    End With

End Sub

适用于

另请参阅