Upravit

Sdílet prostřednictvím


DataGridViewHeaderBorderStyle Enum

Definition

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
Inheritance
DataGridViewHeaderBorderStyle

Fields

Name Value Description
Custom 0

A border that has been customized.

Single 1

A single-line border.

Raised 2

A three-dimensional raised border.

Sunken 3

A three-dimensional sunken border.

None 4

No borders.

Examples

The following code example illustrates the use of this type. 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

Applies to

See also