Moving a Control By Mouse
<p>I am going to Moving a Button with Mouse , Everything is ok , but when I move mouse on button window , left and top of the button ( top-left corner) will locate at cursor pos .</p>

<p>I don't want this to occur . where is the bug in my code ?</p>

<pre><code>private void button1_MouseDown(object sender, MouseEventArgs e)
{
    if (e.Button == System.Windows.Forms.MouseButtons.Left)
    {
        clicked = true;
    }

}

private void button1_MouseMove(object sender, MouseEventArgs e)
{
    if (clicked)
    {
        Point p = new Point();//in form coordinates
        p.X =  e.X + button1.Left;
        p.Y =  e.Y + button1.Top;
        button1.Left = p.X;
        button1.Top = p.Y ;

    }

}

private void button1_MouseUp(object sender, MouseEventArgs e)
{
    clicked = false;   
}
</code></pre>
