DataGridViewHeaderCell.OnMouseEnter(Int32) 方法

定义

当鼠标指针进入单元格时调用。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

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

注解

OnMouseEnter ButtonState Pushed 如果在指针进入单元格时按下鼠标左键,并为标题启用了可视样式,则该方法会将设置为。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.

适用于

另请参阅