DataGridViewButtonCell.OnMouseDown(DataGridViewCellMouseEventArgs) 方法

定义

当指针位于单元格上并按住鼠标按钮时调用。Called when the mouse button is held down while the pointer is on the cell.

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

参数

e
DataGridViewCellMouseEventArgs

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

注解

如果通过按下鼠标左键激活,此方法 (UI) 更新该单元的用户界面。If activated by depressing the left mouse button, this method updates the cell's user interface (UI).

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

继承者说明

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

适用于

另请参阅