QuestionEventArgs 類別

定義

針對需要問題的 truefalse 解答的事件提供資料。

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

範例

下列程式碼範例示範此類型的用法。 在此範例中,事件處理常式會報告事件的發生次數 CancelRowEdit 。 此報告可協助您瞭解事件發生的時間,並可協助您進行偵錯。 若要報告多個事件或經常發生的事件,請考慮將 取代 ShowConsole.WriteLine 或將訊息附加至多行 TextBox

若要執行範例程式碼,請將它貼入包含名為 DataGridView1 之類型 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

備註

這個類別目前與 控制項的 DataGridViewRowDirtyStateNeeded 事件搭配 CancelRowEdit 使用。 它可讓您指定控制項需要問題的答案時所發生的事件回應。 藉由設定 Response 屬性來指定問題的答案。

建構函式

QuestionEventArgs()

使用 false 的預設 QuestionEventArgs 屬性值來初始化 Response 類別的新執行個體。

QuestionEventArgs(Boolean)

使用 QuestionEventArgs 屬性的指定預設值,初始化 Response 類別的新執行個體

屬性

Response

取得或設定值,表示此事件所表示的問題回應。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於

另請參閱