次の方法で共有


DataGridViewCellStateChangedEventArgs.Cell プロパティ

定義

状態が変更された DataGridViewCell を取得します。

public:
 property System::Windows::Forms::DataGridViewCell ^ Cell { System::Windows::Forms::DataGridViewCell ^ get(); };
public System.Windows.Forms.DataGridViewCell Cell { get; }
member this.Cell : System.Windows.Forms.DataGridViewCell
Public ReadOnly Property Cell As DataGridViewCell

プロパティ値

DataGridViewCell

状態が変化した DataGridViewCell

次のコード例は、この型の使用方法を示しています。

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

適用対象

こちらもご覧ください