DataGridViewColumn.DividerWidth 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定欄位分隔器的寬度(像素)。
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
屬性值
分隔器(欄位右邊界)的厚度(以像素計)。
範例
以下程式碼範例在第三欄後增加了一條垂直邊。 此程式碼範例是本類別更大範例 DataGridViewColumn 的一部分。
// 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
備註
此特性有助於提供凍結欄與可捲動欄之間的視覺邊界。 多餘的邊是當前欄位的一部分,雖然它會採用對應 DataGridView的前景色。 額外的邊界並未擴大使用者可雙擊自動調整欄位大小的範圍。 要調整欄位大小,使用者必須雙擊分隔線與相鄰欄位的邊界。