DataGridTableStyle.ResetGridLineColor 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
重設 GridLineColor 屬性為其預設值。
public:
void ResetGridLineColor();
public void ResetGridLineColor ();
member this.ResetGridLineColor : unit -> unit
Public Sub ResetGridLineColor ()
範例
下列程式碼範例示範此成員的使用。
private:
void Button_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
{
// Change the 'GridLineColor'.
myDataTableStyle->GridLineColor = Color::Blue;
}
void Button1_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
{
// Reset the 'GridLineColor' to its orginal color.
myDataTableStyle->ResetGridLineColor();
}
private void Button_Click(object sender, EventArgs e)
{
// Change the 'GridLineColor'.
myDataTableStyle.GridLineColor = Color.Blue;
}
private void Button1_Click(object sender, EventArgs e)
{
// Reset the 'GridLineColor' to its orginal color.
myDataTableStyle.ResetGridLineColor();
}
Private Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs) Handles myButton.Click
' Change the 'GridLineColor'.
myDataTableStyle.GridLineColor = Color.Blue
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles myButton1.Click
' Reset the 'GridLineColor' to its orginal color.
myDataTableStyle.ResetGridLineColor()
End Sub
備註
如果您要為 建立設計工具 DataGridTableStyle ,或建立自己的控制項並 DataGridTableStyle 入 ,您通常會使用這個方法。 您可以使用 ShouldSerializeGridLineColor 方法來判斷屬性值是否已從預設值變更。