DataGridViewCell.OnMouseEnter(Int32) Metoda

Definice

Volá se, když se ukazatel myši přesune na buňku.

protected:
 virtual void OnMouseEnter(int rowIndex);
protected virtual void OnMouseEnter (int rowIndex);
abstract member OnMouseEnter : int -> unit
override this.OnMouseEnter : int -> unit
Protected Overridable Sub OnMouseEnter (rowIndex As Integer)

Parametry

rowIndex
Int32

Index nadřazeného řádku buňky

Příklady

Následující příklad kódu ukazuje použití této metody. Tento příklad je součástí většího příkladu, který je k dispozici v tématu Postupy: Přizpůsobení buněk a sloupců v ovládacím prvku model Windows Forms DataGridView rozšířením jejich chování a vzhledu.

// Force the cell to repaint itself when the mouse pointer enters it.
protected override void OnMouseEnter(int rowIndex)
{
    this.DataGridView.InvalidateCell(this);
}

// Force the cell to repaint itself when the mouse pointer leaves it.
protected override void OnMouseLeave(int rowIndex)
{
    this.DataGridView.InvalidateCell(this);
}
' Force the cell to repaint itself when the mouse pointer enters it.
Protected Overrides Sub OnMouseEnter(ByVal rowIndex As Integer)
    Me.DataGridView.InvalidateCell(Me)
End Sub

' Force the cell to repaint itself when the mouse pointer leaves it.
Protected Overrides Sub OnMouseLeave(ByVal rowIndex As Integer)
    Me.DataGridView.InvalidateCell(Me)
End Sub

Poznámky

Tato metoda je podobná DataGridView.OnCellMouseEnter metodě . Volá se za stejných okolností, za kterých DataGridView.CellMouseEnter je událost vyvolána, ale ve skutečnosti událost nevyvolává.

Platí pro

Viz také