ComponentFactory.Krypton.Toolkit.TrackBarController.MouseDown C# (CSharp) Method

MouseDown() public method

Mouse button has been pressed in the view.
public MouseDown ( Control c, Point pt, MouseButtons button ) : bool
c System.Windows.Forms.Control Reference to the source control instance.
pt Point Mouse position relative to control.
button MouseButtons Mouse button pressed down.
return bool
        public virtual bool MouseDown(Control c, Point pt, MouseButtons button)
        {
            if (button == MouseButtons.Left)
            {
                // Only interested if the mouse is over the track area
                if (_drawTB.ClientRectangle.Contains(pt))
                {
                    _captured = true;

                    // Target value is nearest value to the mouse positon
                    _targetValue = _drawTB.NearestValueFromPoint(pt);
                    _targetHigher = (_targetValue > _drawTB.ViewDrawTrackBar.Value);
                    OnRepeatTimer(_repeatTimer, EventArgs.Empty);

                    // Use timer to keep moving towards the target value
                    _repeatTimer = new Timer();
                    _repeatTimer.Interval = SystemInformation.DoubleClickTime;
                    _repeatTimer.Tick += new EventHandler(OnRepeatTimer);
                    _repeatTimer.Start();
                }
            }

            return _captured;
        }