DataGridViewCell.OnMouseEnter(Int32) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
マウス ポインターがセル上を移動したときに呼び出されます。
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)
パラメーター
- rowIndex
- Int32
セルの親行のインデックス。
例
次のコード例は、このメソッドの使用方法を示しています。 この例は、「方法: Windows フォーム DataGridView コントロールのセルと列をカスタマイズする方法」で使用できる、より大きな例の一部です。その動作と外観を拡張することで。
// 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
注釈
このメソッドは、 DataGridView.OnCellMouseEnter メソッドに似ています。 これは、 DataGridView.CellMouseEnter イベントが発生したのと同じ状況で呼び出されますが、実際にはイベントは発生しません。
適用対象
こちらもご覧ください
- DataGridView
- OnCellMouseEnter(DataGridViewCellEventArgs)
- CellMouseEnter
- OnMouseClick(DataGridViewCellMouseEventArgs)
- OnMouseDoubleClick(DataGridViewCellMouseEventArgs)
- OnMouseDown(DataGridViewCellMouseEventArgs)
- MouseEnterUnsharesRow(Int32)
- OnMouseLeave(Int32)
- OnMouseMove(DataGridViewCellMouseEventArgs)
- OnMouseUp(DataGridViewCellMouseEventArgs)