DataGridView.CellToolTipTextChanged Zdarzenie

Definicja

Występuje, gdy ToolTipText wartość właściwości zmienia się dla komórki w obiekcie DataGridView.

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

Typ zdarzenia

Przykłady

W poniższym przykładzie kodu pokazano użycie tego elementu członkowskiego. W tym przykładzie program obsługi zdarzeń zgłasza wystąpienie CellToolTipTextChanged zdarzenia. Ten raport pomaga dowiedzieć się, kiedy wystąpi zdarzenie, i może pomóc w debugowaniu. Aby zgłosić wiele zdarzeń lub często występujących zdarzeń, rozważ zastąpienie MessageBox.Show komunikatu ciągiem Console.WriteLine lub dołączenie go do wielowierszowego TextBoxelementu .

Aby uruchomić przykładowy kod, wklej go w projekcie zawierającym wystąpienie typu DataGridView o nazwie DataGridView1. Następnie upewnij się, że program obsługi zdarzeń jest skojarzony ze zdarzeniem CellToolTipTextChanged .

private void DataGridView1_CellToolTipTextChanged(Object sender, DataGridViewCellEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "ColumnIndex", e.ColumnIndex );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "RowIndex", e.RowIndex );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "CellToolTipTextChanged Event" );
}
Private Sub DataGridView1_CellToolTipTextChanged(sender as Object, e as DataGridViewCellEventArgs) _ 
     Handles DataGridView1.CellToolTipTextChanged

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

End Sub

Uwagi

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

Dotyczy

Zobacz też