Point _oldPosition = new Point();

private void button1_MouseMove(object sender, MouseEventArgs e)
{
    if (e.Button == MouseButtons.Left)
    {
        panel1.Left += Cursor.Position.X - _oldPosition.X;
        panel1.Top += Cursor.Position.Y - _oldPosition.Y;
        _oldPosition = Cursor.Position;
     }
}

private void button1_MouseDown(object sender, MouseEventArgs e)
{
    _oldPosition = Cursor.Position;
}




获取鼠标拖动坐标:


int x, y;

private void Form1_MouseDown(object sender, MouseEventArgs e)
{
    x = e.X;
    y = e.Y;
}

private void Form1_MouseUp(object sender, MouseEventArgs e)
{
    MessageBox.Show("鼠标按下坐标:" + x + "," + y + "\n鼠标释放坐标:" + e.X + "," + e.Y);
}




黑色头发:http://heisetoufa.iteye.com/