QuestionEventArgs.Response プロパティ

定義

イベントによって表される質問に対する応答を示す値を取得または設定します。

public:
 property bool Response { bool get(); void set(bool value); };
public bool Response { get; set; }
member this.Response : bool with get, set
Public Property Response As Boolean

プロパティ値

肯定的な応答の場合は true。それ以外の場合は false

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

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

private void DataGridView1_CancelRowEdit(Object sender, QuestionEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Response", e.Response );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "CancelRowEdit Event" );
}
Private Sub DataGridView1_CancelRowEdit(sender as Object, e as QuestionEventArgs) _ 
     Handles DataGridView1.CancelRowEdit

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

End Sub

適用対象