private void ColorSlider_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
int x = (ClientRectangle.Right - width) / 2 - 4;
int y = 3 + height;
// check Y coordinate
if ((e.Y >= y) && (e.Y < y + 6))
{
// check X coordinate
if ((e.X >= x + min) && (e.X < x + min + 9))
{
// left arrow
trackMode = 1;
dx = e.X - min;
}
if ((doubleArrow) && (e.X >= x + max) && (e.X < x + max + 9))
{
// right arrow
trackMode = 2;
dx = e.X - max;
}
if (trackMode != 0)
this.Capture = true;
}
}