DataGridTableStyle.ResetForeColor Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Restablece el valor predeterminado de la propiedad ForeColor.
public:
void ResetForeColor();
public void ResetForeColor ();
member this.ResetForeColor : unit -> unit
Public Sub ResetForeColor ()
Ejemplos
En el ejemplo de código siguiente se muestra el uso de este miembro.
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
Comentarios
Normalmente, use este método si va a crear un diseñador para o DataGridTableStyle crear su propio control que incorpore .DataGridTableStyle Puede usar el ShouldSerializeForeColor método para determinar si el valor de la propiedad ha cambiado de su valor predeterminado.