Hi all,
I'm using the following code at the moment to get a panel to drag across the form:
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Point newLoc = new Point(e.X+panel1.Location.X, e.Y+panel1.Location.Y);
panel1.Location = newLoc;
}
}
I had to put the +panel1.Location.X parts in there otherwise it flashes twice on the screen when moving.
The method I am using is working fine, but it always snaps to the top left hand corner of the panel.
Any ideas how I can get around this?
Thanks