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.

備註

當指標進入單元ButtonStatePushed , 而且已針對標頭啟用視覺化樣式時,方法會將設為,如果按下滑鼠左鍵。OnMouseEnterThe 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.

適用於

另請參閱