DataGridTableStyle.ResetAlternatingBackColor Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Rétablit la valeur par défaut de la propriété AlternatingBackColor.
public:
void ResetAlternatingBackColor();
public void ResetAlternatingBackColor ();
member this.ResetAlternatingBackColor : unit -> unit
Public Sub ResetAlternatingBackColor ()
Exemples
L’exemple de code suivant illustre l’utilisation de ce membre.
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
Remarques
Vous utilisez généralement cette méthode si vous créez un concepteur pour le DataGridTableStyle ou si vous créez votre propre contrôle incorporant le DataGridTableStyle. Vous pouvez utiliser la ShouldSerializeAlternatingBackColor méthode pour déterminer si la valeur de propriété a changé de sa valeur par défaut.