編輯

共用方式為


DataGridViewAdvancedCellBorderStyle Enum

Definition

Specifies the border styles that can be applied to the cells of a DataGridView control.

public enum class DataGridViewAdvancedCellBorderStyle
public enum DataGridViewAdvancedCellBorderStyle
type DataGridViewAdvancedCellBorderStyle = 
Public Enum DataGridViewAdvancedCellBorderStyle
Inheritance
DataGridViewAdvancedCellBorderStyle

Fields

Name Value Description
NotSet 0

The border is not set.

None 1

No borders.

Single 2

A single-line border.

Inset 3

A single-line sunken border.

InsetDouble 4

A double-line sunken border.

Outset 5

A single-line raised border.

OutsetDouble 6

A double-line raised border.

OutsetPartial 7

A single-line border containing a raised portion.

Examples

The following code example demonstrates how to override the DataGridView.AdjustedTopLeftHeaderBorderStyle property to customize the borders of the upper-left cell. This code example is part of a larger example provided for the DataGridViewAdvancedBorderStyle class.

public override DataGridViewAdvancedBorderStyle AdjustedTopLeftHeaderBorderStyle
{
    get
    {
        DataGridViewAdvancedBorderStyle newStyle =
            new DataGridViewAdvancedBorderStyle();
        newStyle.Top = DataGridViewAdvancedCellBorderStyle.None;
        newStyle.Left = DataGridViewAdvancedCellBorderStyle.None;
        newStyle.Bottom = DataGridViewAdvancedCellBorderStyle.Outset;
        newStyle.Right = DataGridViewAdvancedCellBorderStyle.OutsetDouble;
        return newStyle;
    }
}
Public Overrides ReadOnly Property AdjustedTopLeftHeaderBorderStyle() _
    As DataGridViewAdvancedBorderStyle
    Get
        Dim newStyle As New DataGridViewAdvancedBorderStyle()
        With newStyle
            .Top = DataGridViewAdvancedCellBorderStyle.None
            .Left = DataGridViewAdvancedCellBorderStyle.None
            .Bottom = DataGridViewAdvancedCellBorderStyle.Outset
            .Right = DataGridViewAdvancedCellBorderStyle.OutsetDouble
        End With
        Return newStyle
    End Get
End Property

Remarks

The AdvancedCellBorderStyle property of the DataGridView control returns an object of type DataGridViewAdvancedBorderStyle, which has properties of type DataGridViewAdvancedCellBorderStyle.

Applies to

See also