J
JezB
I'm trying to create a user control which the user can drag around with the
mouse. Within my control the OnPaint method paints the control correctly,
and I handle OnMouseDown and OnMouseMove to control the dragging. Within the
OnMouseMove I calculate the new co-ordinates and move the control there
(this.Location = ...).
I'm sure my logic is correct in calculating the new co-ordinates. Trouble is
I'm getting a curious flashing double image moving as I drag, and neither
seems to follow the mouse exactly, but I dont know why.
Am I approaching this from the wrong angle ? Do I have to handle dragging
the control within the Parent of that control ? I was trying to put
everything inside the control itself.
Any guidance appreciated. I'm sure someone must have created a draggable
control before, who could help me. Thanks.
mouse. Within my control the OnPaint method paints the control correctly,
and I handle OnMouseDown and OnMouseMove to control the dragging. Within the
OnMouseMove I calculate the new co-ordinates and move the control there
(this.Location = ...).
I'm sure my logic is correct in calculating the new co-ordinates. Trouble is
I'm getting a curious flashing double image moving as I drag, and neither
seems to follow the mouse exactly, but I dont know why.
Am I approaching this from the wrong angle ? Do I have to handle dragging
the control within the Parent of that control ? I was trying to put
everything inside the control itself.
Any guidance appreciated. I'm sure someone must have created a draggable
control before, who could help me. Thanks.