DataGridView.ColumnWidthChanged Evento

Definição

Ocorre quando o valor da Width propriedade para uma coluna muda.

public:
 event System::Windows::Forms::DataGridViewColumnEventHandler ^ ColumnWidthChanged;
public event System.Windows.Forms.DataGridViewColumnEventHandler ColumnWidthChanged;
member this.ColumnWidthChanged : System.Windows.Forms.DataGridViewColumnEventHandler 
Public Custom Event ColumnWidthChanged As DataGridViewColumnEventHandler 

Tipo de Evento

Exemplos

O seguinte exemplo de código ilustra a utilização deste evento. Este exemplo faz parte de um exemplo maior disponível em Como: Personalizar a Aparência das Linhas no Controlo Windows Forms DataGridView.

// Forces the control to repaint itself when the user 
// manually changes the width of a column.
void dataGridView1_ColumnWidthChanged(object sender,
    DataGridViewColumnEventArgs e)
{
    this.dataGridView1.Invalidate();
}
' Forces the control to repaint itself when the user 
' manually changes the width of a column.
Sub dataGridView1_ColumnWidthChanged(ByVal sender As Object, _
    ByVal e As DataGridViewColumnEventArgs) _
    Handles dataGridView1.ColumnWidthChanged

    Me.dataGridView1.Invalidate()

End Sub

Observações

Para mais informações sobre como gerir eventos, consulte Gestão e Levantamento de Eventos.

Aplica-se a

Ver também