DataGridViewTextBoxCell.OnMouseClick(DataGridViewCellMouseEventArgs) 方法

定义

当鼠标离开单元格时,由 DataGridView 调用。Called by DataGridView when the mouse leaves a cell.

protected:
 override void OnMouseClick(System::Windows::Forms::DataGridViewCellMouseEventArgs ^ e);
protected override void OnMouseClick (System.Windows.Forms.DataGridViewCellMouseEventArgs e);
override this.OnMouseClick : System.Windows.Forms.DataGridViewCellMouseEventArgs -> unit
Protected Overrides Sub OnMouseClick (e As DataGridViewCellMouseEventArgs)

参数

e
DataGridViewCellMouseEventArgs

包含事件数据的 DataGridViewCellMouseEventArgsAn DataGridViewCellMouseEventArgs that contains the event data.

注解

OnMouseClick 确定鼠标单击是否为启动编辑会话的双击的一部分。OnMouseClick determines whether the mouse click is part of a double click that starts an edit session.

此方法类似于 Control.OnMouseClick 方法。This method is similar to the Control.OnMouseClick method. 在引发 Control.MouseClick 事件的同一情况下,它会被调用,但实际上不会引发事件。It is called in the same circumstances in which a Control.MouseClick event is raised, but it does not actually raise the event.

继承者说明

在派生类中重写 OnMouseClick(DataGridViewCellMouseEventArgs) 时,一定要调用基类的 OnMouseClick(DataGridViewCellMouseEventArgs) 方法,以便已注册的委托对事件进行接收。When overriding OnMouseClick(DataGridViewCellMouseEventArgs) in a derived class, be sure to call the base class's OnMouseClick(DataGridViewCellMouseEventArgs) method so that registered delegates receive the event.

适用于

另请参阅