DataGridViewCellStateChangedEventArgs DataGridViewCellStateChangedEventArgs DataGridViewCellStateChangedEventArgs DataGridViewCellStateChangedEventArgs Class

定义

CellStateChanged 事件提供数据。Provides data for the CellStateChanged event.

public ref class DataGridViewCellStateChangedEventArgs : EventArgs
public class DataGridViewCellStateChangedEventArgs : EventArgs
type DataGridViewCellStateChangedEventArgs = class
    inherit EventArgs
Public Class DataGridViewCellStateChangedEventArgs
Inherits EventArgs
继承
DataGridViewCellStateChangedEventArgsDataGridViewCellStateChangedEventArgsDataGridViewCellStateChangedEventArgsDataGridViewCellStateChangedEventArgs

示例

下面的代码示例演示如何使用此类型。The following code example illustrates the use of this type.

private void dataGridView1_CellStateChanged(object sender,
    DataGridViewCellStateChangedEventArgs e)
{
    DataGridViewElementStates state = e.StateChanged;
    string msg = String.Format("Row {0}, Column {1}, {2}",
        e.Cell.RowIndex, e.Cell.ColumnIndex, e.StateChanged);
    MessageBox.Show(msg, "Cell State Changed");
}
Private Sub dataGridView1_CellStateChanged(ByVal sender As Object, _
    ByVal e As DataGridViewCellStateChangedEventArgs) _
    Handles dataGridView1.CellStateChanged

    Dim state As DataGridViewElementStates = e.StateChanged
    Dim msg As String = String.Format( _
        "Row {0}, Column {1}, {2}", _
        e.Cell.RowIndex, e.Cell.ColumnIndex, e.StateChanged)
    MessageBox.Show(msg, "Cell State Changed")

End Sub

注解

使用Cell属性来确定哪个单元格更改。Use the Cell property to determine which cell changed. 使用StateChanged属性以确定哪个单元格状态更改。Use the StateChanged property to determine which cell state changed.

有关如何处理事件的详细信息,请参阅处理和引发事件For more information about how to handle events, see Handling and Raising Events.

构造函数

DataGridViewCellStateChangedEventArgs(DataGridViewCell, DataGridViewElementStates) DataGridViewCellStateChangedEventArgs(DataGridViewCell, DataGridViewElementStates) DataGridViewCellStateChangedEventArgs(DataGridViewCell, DataGridViewElementStates) DataGridViewCellStateChangedEventArgs(DataGridViewCell, DataGridViewElementStates)

初始化 DataGridViewCellStateChangedEventArgs 类的新实例。Initializes a new instance of the DataGridViewCellStateChangedEventArgs class.

属性

Cell Cell Cell Cell

获取更改了状态的 DataGridViewCellGets the DataGridViewCell that has a changed state.

StateChanged StateChanged StateChanged StateChanged

获取已更改的单元格状态。Gets the state that has changed on the cell.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于

另请参阅