Compartilhar via


DataGridTableStyle.ResetForeColor Método

Definição

Redefine a propriedade ForeColor para seu valor padrão.

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

Exemplos

O exemplo de código a seguir demonstra o uso desse membro.

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

Comentários

Normalmente, você usa esse método se estiver criando um designer para o DataGridTableStyle ou criando seu próprio controle incorporando o DataGridTableStyle. Você pode usar o ShouldSerializeForeColor método para determinar se o valor da propriedade foi alterado de seu padrão.

Aplica-se a