DataGridView.ColumnWidthChanged Zdarzenie

Definicja

Występuje, gdy wartość Width właściwości kolumny ulegnie zmianie.

public:
 event System::Windows::Forms::DataGridViewColumnEventHandler ^ ColumnWidthChanged;
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 

Typ zdarzenia

Przykłady

Poniższy przykład kodu ilustruje użycie tego zdarzenia. Ten przykład jest częścią większego przykładu dostępnego w temacie How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control (Dostosowywanie wyglądu wierszy w kontrolce 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

Uwagi

Aby uzyskać więcej informacji na temat obsługi zdarzeń, zobacz Obsługa i podnoszenie zdarzeń.

Dotyczy

Zobacz też