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 来确定属性值是否已从默认值更改。

适用于