TpTrayUtility.Components.TpScrollBar.OnMouseDown C# (CSharp) Method

OnMouseDown() protected method

protected OnMouseDown ( MouseEventArgs e ) : void
e MouseEventArgs
return void
		protected override void OnMouseDown(MouseEventArgs e)
		{
			int PageSize = 0;
			if (PositionCount > 0)
				PageSize = Math.Max(sliderSize, Height/PositionCount);

			if (e.Y >= sliderPosition && e.Y < sliderPosition + PageSize)
			{
				isDragMode = true;
				dragValue = e.Y;
			}
			else if (e.Y < sliderPosition)
			{
				Position--;
				Invalidate();

				if (ValueChanged != null)
					ValueChanged(this, new EventArgs());
				repeatClickTimer.Interval = 500;
				repeatClickTimer.Start();
			}
			else if (e.Y > sliderPosition + PageSize)
			{
				Position++;
				Invalidate();
				if (ValueChanged != null)
					ValueChanged(this, new EventArgs());
				repeatClickTimer.Interval = 500;
				repeatClickTimer.Start();
			}
			base.OnMouseDown(e);
		}