DataGridView.OnCellContentClick(DataGridViewCellEventArgs) 方法

定义

引发 CellContentClick 事件。

protected:
 virtual void OnCellContentClick(System::Windows::Forms::DataGridViewCellEventArgs ^ e);
protected virtual void OnCellContentClick (System.Windows.Forms.DataGridViewCellEventArgs e);
abstract member OnCellContentClick : System.Windows.Forms.DataGridViewCellEventArgs -> unit
override this.OnCellContentClick : System.Windows.Forms.DataGridViewCellEventArgs -> unit
Protected Overridable Sub OnCellContentClick (e As DataGridViewCellEventArgs)

参数

e
DataGridViewCellEventArgs

一个 DataGridViewCellEventArgs,包含有关内容被单击的单元格的信息。

例外

eColumnIndex 属性值大于控件中的列数减一。

- 或 -

eRowIndex 属性值大于控件中的行数减一。

注解

引发事件时,将通过委托调用事件处理程序。 有关详细信息,请参阅 处理和引发事件

OnCellContentClick 方法还允许派生类对事件进行处理而不必附加委托。 这是在派生类中处理事件的首选技术。

继承者说明

在派生类中重写 OnCellContentClick(DataGridViewCellEventArgs) 时,请务必调用基类的 OnCellContentClick(DataGridViewCellEventArgs) 方法,以便注册的委托接收事件。

适用于

另请参阅