DataGridTableStyle.ResetForeColor Méthode

Définition

Rétablit la valeur par défaut de la propriété ForeColor.

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

Exemples

L’exemple de code suivant illustre l’utilisation de ce membre.

private:
   void BtnSetForeColor_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // Set the foreground color of table.
      myDataGridTableStyle->ForeColor = Color::Blue;
      myDataGrid->TableStyles->Add( myDataGridTableStyle );
   }

   void BtnResetForeColor_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // Reset the foreground color of table to its default value.
      myDataGridTableStyle->ResetForeColor();
   }
 private void BtnSetForeColor_Click(Object sender, EventArgs e)
 {
    // Set the foreground color of table.
    myDataGridTableStyle.ForeColor=Color.Blue;
    myDataGrid.TableStyles.Add(myDataGridTableStyle);
 }
private void BtnResetForeColor_Click(Object sender, EventArgs e)
{
   // Reset the foreground color of table to its default value.
   myDataGridTableStyle.ResetForeColor();
}
  Private Sub BtnSetForeColor_Click(ByVal sender As Object, ByVal e As EventArgs)
      ' Set the foreground color of table.
      myDataGridTableStyle.ForeColor = Color.Blue
      myDataGrid.TableStyles.Add(myDataGridTableStyle)
  End Sub

  Private Sub BtnResetForeColor_Click(ByVal sender As Object, ByVal e As EventArgs)
      ' Reset the foreground color of table to its default value.
      myDataGridTableStyle.ResetForeColor()
  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 ShouldSerializeForeColor méthode pour déterminer si la valeur de propriété a changé de sa valeur par défaut.

S’applique à