DataGridView.BackgroundColorChanged Événement

Définition

Se produit quand la valeur de la propriété BackgroundColor change.

public:
 event EventHandler ^ BackgroundColorChanged;
public event EventHandler BackgroundColorChanged;
public event EventHandler? BackgroundColorChanged;
member this.BackgroundColorChanged : EventHandler 
Public Custom Event BackgroundColorChanged As EventHandler 

Type d'événement

Exemples

L’exemple de code suivant illustre l’utilisation de ce membre. Dans l’exemple, un gestionnaire d’événements signale l’occurrence de l’événement BackgroundColorChanged . Ce rapport vous aide à savoir quand l’événement se produit et peut vous aider à déboguer. Pour signaler plusieurs événements ou événements qui se produisent fréquemment, envisagez de MessageBox.ShowConsole.WriteLine remplacer par ou d’ajouter le message à un multiligne TextBox.

Pour exécuter l’exemple de code, collez-le dans un projet qui contient un instance de type DataGridView nommé DataGridView1. Vérifiez ensuite que le gestionnaire d’événements est associé à l’événement BackgroundColorChanged .

private void DataGridView1_BackgroundColorChanged(Object sender, EventArgs e) {

   MessageBox.Show("You are in the DataGridView.BackgroundColorChanged event.");
}
Private Sub DataGridView1_BackgroundColorChanged(sender as Object, e as EventArgs) _ 
     Handles DataGridView1.BackgroundColorChanged

   MessageBox.Show("You are in the DataGridView.BackgroundColorChanged event.")

End Sub

Remarques

Pour plus d’informations sur la façon de gérer les événements, consultez gestion et déclenchement d’événements.

S’applique à

Voir aussi