I use MouseMove event to move objects(say labels).
simple principle(schematic):
OnMouseMove(e MouseEventArgs)
if e.Button == Left
deltaX = e.X - lastX
foreach label in labels
label.Location.X += deltaX
lastX = e.X
Once the labels number increase, I start to see the labels traces along the moving trajectory. I have something like I I I II III II I I III II, but want to have something like I I I I as traces. I'd like to know when the mouse "starts" and "stops to move" something like this.
I move labels along a horizontal axe. MouseDown
(set LastX) and go on. Nobody knows when stops, only mouse move sensibility. Surely I can use MouseUp
to know when the movement ends, but however if user maintains the button down and stop moving I want to reflect the latest label position.
Is there a way to prevent this kind of traces?
tried
label.Visible = false
label.Location.X += deltaX
label.Visible = true
does not help.
parent.SuspendLayout and ResumeLayout does not help a lot, because I need doing this at every mouse movement, so any effect.