public virtual void MouseMove(Control c, Point pt)
{
if (_captured)
{
// Only interested if the mouse is over the track area
if (_drawTB.ClientRectangle.Contains(pt))
{
// Ignore multiple calls with the same point
if ((_lastMovePt == null) || (_lastMovePt != pt))
{
_lastMovePt = pt;
// Restart the timer
_repeatTimer.Stop();
_repeatTimer.Start();
// Only use newly calculated target value if in correct direction
int newTargetValue = _drawTB.NearestValueFromPoint(pt);
int currentValue = _drawTB.ViewDrawTrackBar.Value;
if (_targetHigher)
{
if (newTargetValue > currentValue)
_targetValue = newTargetValue;
}
else
{
if (newTargetValue < currentValue)
_targetValue = newTargetValue;
}
OnRepeatTimer(_repeatTimer, EventArgs.Empty);
}
}
}
}