DataGridTableStyle.ResetForeColor Methode

Definition

Setzt die ForeColor-Eigenschaft auf den Standardwert zurück.Resets the ForeColor property to its default value.

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

Beispiele

Im folgenden Codebeispiel wird die Verwendung dieses Members veranschaulicht.The following code example demonstrates the use of this member.

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

Hinweise

Normalerweise verwenden Sie diese Methode, wenn Sie einen Designer für die DataGridTableStyle erstellen oder ein eigenes Steuerelement erstellen, das die DataGridTableStyleeinschließt.You typically use this method if you are either creating a designer for the DataGridTableStyle or creating your own control incorporating the DataGridTableStyle. Sie können die ShouldSerializeForeColor-Methode verwenden, um zu bestimmen, ob sich der Eigenschafts Wert von seinem Standardwert geändert hat.You can use the ShouldSerializeForeColor method to determine whether the property value has changed from its default.

Gilt für: