DataGridViewCellCancelEventArgs 類別

定義

提供 CellBeginEditRowValidating 事件的資料。

public ref class DataGridViewCellCancelEventArgs : System::ComponentModel::CancelEventArgs
public class DataGridViewCellCancelEventArgs : System.ComponentModel.CancelEventArgs
type DataGridViewCellCancelEventArgs = class
    inherit CancelEventArgs
Public Class DataGridViewCellCancelEventArgs
Inherits CancelEventArgs
繼承
DataGridViewCellCancelEventArgs
衍生

範例

下列程式碼範例說明此類型的用法。

private void dataGridView1_CellBeginEdit(object sender,
    DataGridViewCellCancelEventArgs e)
{
    string msg = String.Format("Editing Cell at ({0}, {1})",
        e.ColumnIndex, e.RowIndex);
    this.Text = msg;
}

private void dataGridView1_CellEndEdit(object sender,
    DataGridViewCellEventArgs e)
{
    string msg = String.Format("Finished Editing Cell at ({0}, {1})",
        e.ColumnIndex, e.RowIndex);
    this.Text = msg;
}
Private Sub dataGridView1_CellBeginEdit(ByVal sender As Object, _
    ByVal e As DataGridViewCellCancelEventArgs) _
    Handles DataGridView1.CellBeginEdit

    Dim msg As String = _
        String.Format("Editing Cell at ({0}, {1})", _
        e.ColumnIndex, e.RowIndex)
    Me.Text = msg

End Sub

Private Sub dataGridView1_CellEndEdit(ByVal sender As Object, _
    ByVal e As DataGridViewCellEventArgs) _
    Handles DataGridView1.CellEndEdit

    Dim msg As String = _
        String.Format("Finished Editing Cell at ({0}, {1})", _
        e.ColumnIndex, e.RowIndex)
    Me.Text = msg

End Sub

建構函式

DataGridViewCellCancelEventArgs(Int32, Int32)

初始化 DataGridViewCellCancelEventArgs 類別的新執行個體。

屬性

Cancel

取得或設定值,這個值表示是否應該取消事件。

(繼承來源 CancelEventArgs)
ColumnIndex

取得發生該事件之儲存格的資料行索引。

RowIndex

取得發生該事件之儲存格的資料列索引。

方法

Equals(Object)

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

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

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

(繼承來源 Object)

適用於

另請參閱