DataGridView.OnEditModeChanged(EventArgs) 方法

定义

引发 EditModeChanged 事件。Raises the EditModeChanged event.

protected:
 virtual void OnEditModeChanged(EventArgs ^ e);
protected virtual void OnEditModeChanged (EventArgs e);
abstract member OnEditModeChanged : EventArgs -> unit
override this.OnEditModeChanged : EventArgs -> unit
Protected Overridable Sub OnEditModeChanged (e As EventArgs)

参数

e
EventArgs

包含事件数据的 EventArgsAn EventArgs that contains the event data.

异常

进入编辑模式后,当前单元格的 EditType 属性不表示派生自 Control 并实现 IDataGridViewEditingControl 的类。When entering edit mode, the EditType property of the current cell does not indicate a class that derives from Control and implements IDataGridViewEditingControl.

注解

@No__t 的属性更改时,将引发 EditModeChanged 事件。The EditModeChanged event is raised whenever the EditMode property changes.

引发事件时,将通过委托调用事件处理程序。Raising an event invokes the event handler through a delegate. 有关详细信息,请参阅处理和引发事件For more information, see Handling and Raising Events.

OnEditModeChanged 方法还允许派生类对事件进行处理而不必附加委托。The OnEditModeChanged method also allows derived classes to handle the event without attaching a delegate. 这是在派生类中处理事件的首选技术。This is the preferred technique for handling the event in a derived class.

继承者说明

在派生类中重写 OnEditModeChanged(EventArgs) 时,请确保调用基类 "OnEditModeChanged(EventArgs) 方法,以便注册的委托接收事件。When overriding OnEditModeChanged(EventArgs) in a derived class, be sure to call the base class' OnEditModeChanged(EventArgs) method so that registered delegates receive the event.

适用于

另请参阅