DataGridView.CellErrorTextChanged イベント

定義

セルの ErrorText プロパティの値が変更されたときに発生します。

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

イベントの種類

次のコード例では、このメンバーの使用方法を示します。 この例では、イベント ハンドラーがイベントの CellErrorTextChanged 発生を報告します。 このレポートは、イベントが発生したタイミングを確認するのに役立ち、デバッグに役立ちます。 複数のイベントまたは頻繁に発生するイベントを報告するには、 を Console.WriteLine に置き換えるかMessageBox.Show、複数行TextBoxにメッセージを追加することを検討してください。

コード例を実行するには、 という名前DataGridView1の型DataGridViewのインスタンスを含むプロジェクトに貼り付けます。 次に、イベント ハンドラーがイベントに関連付けられていることを確認します CellErrorTextChanged

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

    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(),"CellErrorTextChanged Event")

End Sub

注釈

イベントを処理する方法の詳細については、次を参照してください。処理とイベントの発生します。

適用対象

こちらもご覧ください