DataGridViewHeaderCell.OnMouseEnter(Int32) DataGridViewHeaderCell.OnMouseEnter(Int32) DataGridViewHeaderCell.OnMouseEnter(Int32) DataGridViewHeaderCell.OnMouseEnter(Int32) Method

定义

当鼠标指针进入单元格时调用。Called when the mouse pointer enters the cell.

protected:
 override void OnMouseEnter(int rowIndex);
protected override void OnMouseEnter (int rowIndex);
override this.OnMouseEnter : int -> unit
Protected Overrides Sub OnMouseEnter (rowIndex As Integer)

参数

rowIndex
Int32 Int32 Int32 Int32

包含该单元格的行的索引。The index of the row containing the cell.

注解

OnMouseEnter方法设置ButtonStatePushed指针进入单元格和视觉样式已启用的标头时如果按下鼠标左键。The OnMouseEnter method sets the ButtonState to Pushed if the left mouse button is pressed when the pointer enters the cell and visual styles are enabled for headers. 对于标头的视觉样式的详细信息,请参阅DataGridView.EnableHeadersVisualStyles属性。For more information about visual styles for headers, see the DataGridView.EnableHeadersVisualStyles property.

此方法是类似于DataGridView.OnCellMouseEnter方法。This method is similar to the DataGridView.OnCellMouseEnter method. 在同一环境中调用DataGridView.CellMouseEnter引发事件,但不会实际引发该事件。It is called in the same circumstances in which a DataGridView.CellMouseEnter event is raised, but it does not actually raise the event.

继承者说明

重写时OnMouseEnter(Int32)在派生类中,请务必调用基类的OnMouseEnter(Int32)方法。When overriding OnMouseEnter(Int32) in a derived class, be sure to call the base class's OnMouseEnter(Int32) method.

适用于

另请参阅