DataGridViewCell.OnMouseLeave(Int32) Metodo

Definizione

Chiamato quando il puntatore del mouse esce dalla cella.Called when the mouse pointer leaves the cell.

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)

Parametri

rowIndex
Int32

Indice della riga padre della cella.The index of the cell's parent row.

Esempio

Nell'esempio di codice riportato di seguito viene illustrato l'utilizzo di questo metodo.The following code example illustrates the use of this method. Questo esempio fa parte di un esempio più ampio disponibile in procedura: personalizzare le celle e le colonne nel controllo Windows Form DataGridView estendendo il comportamento e l'aspetto.This example is part of a larger example available in How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance.

// 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

Commenti

Questo metodo è simile al DataGridView.OnCellMouseLeave metodo.This method is similar to the DataGridView.OnCellMouseLeave method. Viene chiamato nelle stesse circostanze in cui DataGridView.CellMouseLeave viene generato un evento, ma non genera effettivamente l'evento.It is called in the same circumstances in which a DataGridView.CellMouseLeave event is raised, but it does not actually raise the event.

Si applica a

Vedi anche