Move rectangle with same mouse position in regard to rectangle?
<p>I need to move (draw) rectangle with same mouse position in regard to rectangle. There is a code where mouse is in the middle of rectangle.</p>

<pre><code>private void pictureBox1_MouseMove_1(object sender, MouseEventArgs e)
{
    if (e.Button == MouseButtons.Left)
    {
        rect.X = e.X - (rect.Width/2);
        rect.Y = e.Y - (rect.Height/2);

        rect.Width = rect.Width;
        rect.Height = rect.Height;
        pictureBox1.Invalidate();
    }
}
</code></pre>
