DataGridView.AlternatingRowsDefaultCellStyleChanged Evento

Definição

Ocorre quando o valor da propriedade AlternatingRowsDefaultCellStyle muda.

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

Tipo de evento

Exemplos

O exemplo de código a seguir demonstra o uso desse membro. No exemplo, um manipulador de eventos relata a ocorrência do AlternatingRowsDefaultCellStyleChanged evento. Este relatório ajuda você a aprender quando o evento ocorre e pode ajudá-lo na depuração. Para relatar vários eventos ou eventos que ocorrem com frequência, considere substituir MessageBox.ShowConsole.WriteLine ou acrescentar a mensagem a uma multilinha TextBox.

Para executar o código de exemplo, cole-o em um projeto que contém uma instância do tipo DataGridView chamada DataGridView1. Em seguida, verifique se o manipulador de eventos está associado ao AlternatingRowsDefaultCellStyleChanged evento.

private void DataGridView1_AlternatingRowsDefaultCellStyleChanged(Object sender, EventArgs e) {

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

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

End Sub

Comentários

Esse evento ocorre quando qualquer propriedade do DataGridViewCellStyle retornado pela AlternatingRowsDefaultCellStyle propriedade é definida como um novo valor ou quando a AlternatingRowsDefaultCellStyle propriedade é definida como uma nova DataGridViewCellStyle com pelo menos um valor de propriedade diferente do objeto de estilo de célula anterior.

Para obter mais informações sobre como lidar com eventos, consulte Manipulando e levantando eventos.

Aplica-se a

Confira também