DataGridTableStyle.ResetAlternatingBackColor 方法

定義

重設 AlternatingBackColor 屬性為其預設值。

public:
 void ResetAlternatingBackColor();
public void ResetAlternatingBackColor ();
member this.ResetAlternatingBackColor : unit -> unit
Public Sub ResetAlternatingBackColor ()

範例

下列程式碼範例示範如何使用這個成員。

private:
   void myButton1_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      //Set the 'AlternatingBackColor'.
      myDataGridTableStyle->AlternatingBackColor = Color::Blue;
   }

   void myButton2_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // Reset the 'AlternatingBackColor'.
      myDataGridTableStyle->ResetAlternatingBackColor();
   }
private void myButton1_Click(object sender,EventArgs e)
{
   //Set the 'AlternatingBackColor'.
   myDataGridTableStyle.AlternatingBackColor=Color.Blue;
}
private void myButton2_Click(object sender,EventArgs e)
{
   // Reset the 'AlternatingBackColor'.
   myDataGridTableStyle.ResetAlternatingBackColor();
}
Private Sub myButton1_Click(sender As Object, e As EventArgs)
   'Set the 'AlternatingBackColor'.
   myDataGridTableStyle.AlternatingBackColor = Color.Blue
End Sub

Private Sub myButton2_Click(sender As Object, e As EventArgs)
   ' Reset the 'AlternatingBackColor'.
   myDataGridTableStyle.ResetAlternatingBackColor()
End Sub

備註

如果您要為 建立設計工具 DataGridTableStyle ,或建立自己的控制項並 DataGridTableStyle 入 ,您通常會使用這個方法。 您可以使用 ShouldSerializeAlternatingBackColor 方法來判斷屬性值是否已從預設值變更。

適用於