DataGridView.ColumnMinimumWidthChanged Událost

Definice

Nastane, když se změní hodnota MinimumWidth vlastnosti sloupce.

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

Event Type

Příklady

Následující příklad kódu ukazuje použití tohoto člena. V tomto příkladu obslužná rutina události hlásí výskyt ColumnMinimumWidthChanged události. Tato sestava vám pomůže zjistit, kdy k události dojde, a může vám pomoct při ladění. Chcete-li hlásit více událostí nebo událostí, ke kterým dochází často, zvažte nahrazení MessageBox.ShowConsole.WriteLine nebo připojení zprávy do víceřádkového řetězce TextBox.

Pokud chcete spustit ukázkový kód, vložte ho do projektu, který obsahuje instanci typu DataGridView s názvem DataGridView1. Potom se ujistěte, že je obslužná rutina události přidružená k ColumnMinimumWidthChanged události.

private void DataGridView1_ColumnMinimumWidthChanged(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(), "ColumnMinimumWidthChanged Event" );
}
Private Sub DataGridView1_ColumnMinimumWidthChanged(sender as Object, e as DataGridViewColumnEventArgs) _ 
     Handles DataGridView1.ColumnMinimumWidthChanged

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

End Sub

Poznámky

Další informace o zpracování událostí naleznete v tématu Zpracování a vyvolávání událostí.

Platí pro

Viz také