DataGridViewCell.OnMouseLeave(Int32) Metoda

Definice

Volá se, když ukazatel myši opustí buňku.

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

Parametry

rowIndex
Int32

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

Příklady

Následující příklad kódu znázorňuje použití této metody. Tento příklad je součástí většího příkladu, který je k dispozici v části 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.OnCellMouseLeave metodě. Volá se za stejných okolností, za jakých DataGridView.CellMouseLeave je událost vyvolána, ale ve skutečnosti událost nevyvolá.

Platí pro

Viz také