DataGridTableStyle.ResetBackColor 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 BackColor.
public:
void ResetBackColor();
public void ResetBackColor ();
member this.ResetBackColor : unit -> unit
Public Sub ResetBackColor ()
Ejemplos
En el ejemplo de código siguiente se muestra el uso de este miembro.
private:
void AddCustomColumnStyle()
{
// Set the TableStyle Mapping name.
myTableStyle->MappingName = "customerTable";
myTableStyle->BackColor = Color::Pink;
// Set the ColumnStyle properties and add to TableStyle.
myColumnStyle->MappingName = "Customers";
myColumnStyle->HeaderText = "Customer Name";
myColumnStyle->Width = 250;
myTableStyle->GridColumnStyles->Add( myColumnStyle );
myDataGrid->TableStyles->Add( myTableStyle );
}
void myButton1_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
{
// Reset the background color.
myTableStyle->ResetBackColor();
}
private void AddCustomColumnStyle()
{
// Set the TableStyle Mapping name.
myTableStyle.MappingName = "customerTable";
myTableStyle.BackColor = Color.Pink;
// Set the ColumnStyle properties and add to TableStyle.
myColumnStyle.MappingName = "Customers";
myColumnStyle.HeaderText = "Customer Name";
myColumnStyle.Width = 250;
myTableStyle.GridColumnStyles.Add(myColumnStyle);
myDataGrid.TableStyles.Add(myTableStyle);
}
private void myButton1_Click(object sender, EventArgs e)
{
// Reset the background color.
myTableStyle.ResetBackColor();
}
Private Sub AddCustomColumnStyle()
' Set the TableStyle Mapping name.
myTableStyle.MappingName = "customerTable"
myTableStyle.BackColor = Color.Pink
' Set the ColumnStyle properties and add to TableStyle.
myColumnStyle.MappingName = "Customers"
myColumnStyle.HeaderText = "Customer Name"
myColumnStyle.Width = 250
myTableStyle.GridColumnStyles.Add(myColumnStyle)
myDataGrid.TableStyles.Add(myTableStyle)
End Sub
Private Sub myButton1_Click(sender As Object, e As EventArgs)
' Reset the background color.
myTableStyle.ResetBackColor()
End Sub
Comentarios
Normalmente, use este método si va a crear un diseñador para DataGridTableStyle o crear su propio control que incorpore .DataGridTableStyle
Se aplica a
Comentarios
https://aka.ms/ContentUserFeedback.
Próximamente: A lo largo de 2024 iremos eliminando gradualmente GitHub Issues como mecanismo de comentarios sobre el contenido y lo sustituiremos por un nuevo sistema de comentarios. Para más información, vea:Enviar y ver comentarios de