I have 2 movable pictureboxes which allow the user to move images around and align them how he want
As I drag picturebox A over picturebox B , there is a trailing part of the image of A showing into B. It dissapears very quickly. This is the same thing you would see on very old Windows with bad resolution.
The particularity of it is that it only shows within the static picturebox, not the empty space underneath. I’ve been fiddling with suspend layout and resume layout without much luck. Any suggestions? I am also open to changing the control type from Picturebox to something else if that will help.
public void OnMouseMove(object sender, MouseEventArgs mouseEventArgs)
{
var control = sender as Control;
control.SuspendLayout();
Point pt = new Point(mouseEventArgs.X, mouseEventArgs.Y);
control.Left += pt.X - _startDraggingPoint.X;
control.Top += pt.Y - _startDraggingPoint.Y;
control.ResumeLayout();
}
In the end, I went with a different solution. We used DevExpress’s document manager to hold our image controls. It took a bit of work but it works better and the results are smooth.