DataGridViewCell.OnMouseLeave(Int32) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Anropas när muspekaren lämnar cellen.
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)
Parametrar
- rowIndex
- Int32
Indexet för cellens överordnade rad.
Exempel
Följande kodexempel illustrerar användningen av den här metoden. Det här exemplet är en del av ett större exempel i Hur du: Anpassa celler och kolumner i Windows Forms DataGridView-kontrollen genom att utöka deras beteende och utseende.
// 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
Kommentarer
Den här metoden liknar DataGridView.OnCellMouseLeave metoden. Det anropas under samma omständigheter där en DataGridView.CellMouseLeave händelse upphöjs, men den väcker inte händelsen.
Gäller för
Se även
- DataGridView
- OnCellMouseLeave(DataGridViewCellEventArgs)
- CellMouseLeave
- OnMouseClick(DataGridViewCellMouseEventArgs)
- OnMouseDoubleClick(DataGridViewCellMouseEventArgs)
- OnMouseDown(DataGridViewCellMouseEventArgs)
- OnMouseEnter(Int32)
- MouseLeaveUnsharesRow(Int32)
- OnMouseMove(DataGridViewCellMouseEventArgs)
- OnMouseUp(DataGridViewCellMouseEventArgs)