DataGridView.ColumnDividerWidthChanged Evento

Definición

Se produce cuando cambia la propiedad DividerWidth.

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

Tipo de evento

Ejemplos

En el ejemplo de código siguiente se muestra el uso de este miembro. En el ejemplo, un controlador de eventos informa sobre la aparición del ColumnDividerWidthChanged evento. Este informe le ayuda a aprender cuándo se produce el evento y puede ayudarle a depurar. Para informar sobre varios eventos o eventos que se producen con frecuencia, considere la posibilidad de reemplazar MessageBox.ShowConsole.WriteLine por o anexar el mensaje a una línea TextBoxmúltiple.

Para ejecutar el código de ejemplo, péguelo en un proyecto que contenga una instancia de tipo DataGridView denominada DataGridView1. A continuación, asegúrese de que el controlador de eventos está asociado al ColumnDividerWidthChanged evento.

private void DataGridView1_ColumnDividerWidthChanged(Object sender, DataGridViewColumnEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Column", e.Column );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "ColumnDividerWidthChanged Event" );
}
Private Sub DataGridView1_ColumnDividerWidthChanged(sender as Object, e as DataGridViewColumnEventArgs) _ 
     Handles DataGridView1.ColumnDividerWidthChanged

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "Column", e.Column)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"ColumnDividerWidthChanged Event")

End Sub

Comentarios

Para obtener más información acerca de cómo controlar eventos, vea controlar y provocar eventos.

Se aplica a

Consulte también