QuestionEventArgs クラス

定義

質問に対する true または false の答えを必要とするイベントのデータを提供します。

public ref class QuestionEventArgs : EventArgs
public class QuestionEventArgs : EventArgs
type QuestionEventArgs = class
    inherit EventArgs
Public Class QuestionEventArgs
Inherits EventArgs
継承
QuestionEventArgs

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

コード例を実行するには、名前付きのDataGridView1DataGridViewのインスタンスを含むプロジェクトに貼り付けます。 次に、イベント ハンドラーがイベントに関連付けられていることを確認します 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

注釈

このクラスは現在、コントロールの CancelRowEdit イベントと RowDirtyStateNeeded 共に DataGridView 使用されています。 これにより、コントロールが質問に対する回答を必要とする場合に発生するイベントに対する応答を指定できます。 質問に対する回答は、プロパティを Response 設定することによって指定されます。

コンストラクター

QuestionEventArgs()

QuestionEventArgs プロパティに既定値の false を使用して、Response クラスの新しいインスタンスを初期化します。

QuestionEventArgs(Boolean)

QuestionEventArgs プロパティに指定した既定値を使用して、Response クラスの新しいインスタンスを初期化します。

プロパティ

Response

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

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください