共用方式為


DataGrid.GridLineColor 屬性

定義

取得或設定格線色彩。

public:
 property System::Drawing::Color GridLineColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };
public System.Drawing.Color GridLineColor { get; set; }
member this.GridLineColor : System.Drawing.Color with get, set
Public Property GridLineColor As Color

屬性值

Color

Color,代表格線色彩。 預設值為控制項系統色彩 (Control)。

例外狀況

這個值並未設定。

範例

下列程式碼範例會使用傳遞至 方法的值,設定格線的色彩。

private:
   void SetGridLineColor(
      DataGrid^ myGrid, System::Drawing::Color newcolor )
   {
      myGrid->GridLineColor = newcolor;
   }
private void SetGridLineColor
(DataGrid myGrid, System.Drawing.Color newcolor)
{
   myGrid.GridLineColor = newcolor;
}
Private Sub SetGridLineColor(myGrid As DataGrid, newcolor As System.Drawing.Color)
    myGrid.GridLineColor = newcolor
End Sub

備註

如果 屬性設定為 DataGridLineStyle.NoneGridLineStyle 則不會顯示格線。

適用於

另請參閱