DataGridViewColumn.DividerWidth DataGridViewColumn.DividerWidth DataGridViewColumn.DividerWidth DataGridViewColumn.DividerWidth Property

定義

取得或設定資料行分割線的寬度 (以像素為單位)。Gets or sets the width, in pixels, of the column divider.

public:
 property int DividerWidth { int get(); void set(int value); };
public int DividerWidth { get; set; }
member this.DividerWidth : int with get, set
Public Property DividerWidth As Integer

屬性值

分割線 (資料行的右邊界) 的粗細 (以像素為單位)。The thickness, in pixels, of the divider (the column's right margin).

範例

下列程式碼範例會在第三個數據行之後加入垂直邊緣。The following code example adds a vertical edge after the third column. 這個程式碼範例是針對DataGridViewColumn類別提供之較大範例的一部分。This code example is part of a larger example provided for the DataGridViewColumn class.

// Set the vertical edge.
void Button7_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   int thirdColumn = 2;
   
   //        int edgeThickness = 5;
   DataGridViewColumn^ column = dataGridView->Columns[ thirdColumn ];
   column->DividerWidth = 10;
}


// Set the vertical edge.
private void Button7_Click(object sender,
    System.EventArgs e)
{
    int thirdColumn = 2;
    DataGridViewColumn column =
        dataGridView.Columns[thirdColumn];
    column.DividerWidth = 10;
}
' Set the vertical edge.
Private Sub Button7_Click(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles Button7.Click

    Dim thirdColumn As Integer = 2
    Dim column As DataGridViewColumn = _
        dataGridView.Columns(thirdColumn)
    column.DividerWidth = 10

End Sub

備註

在凍結的資料行和可以滾動的資料行之間提供視覺界限時,這個屬性會很有用。This property is useful to provide a visual boundary between frozen columns and columns that can scroll. 額外的邊緣是目前資料行的一部分,雖然它會採用相關聯之DataGridView的前景色彩。The extra edge is part of the current column, although it will take on the foreground color of the associated DataGridView. 額外的邊緣不會擴充使用者可以按兩下以自動調整資料行大小的區域。The extra edge does not extend the area in which users can double-click to automatically resize a column. 若要調整資料行的大小,使用者必須按兩下分隔線與相鄰資料行之間的界限。To resize a column, the user must double-click on the boundary between the divider and the adjacent column.

適用於

另請參閱