"Atul Rane" wrote:
I have one panel in which i have my control, know i want to move it at run
time using mouse.
Hi Atul,
Handle the MouseMove/MouseDown/MouseUp events on your control. Keep track
of where the mouse was last and calculate the offset when the MouseButton is
down. Adjust the Location property of the Control accordingly. It will
appear to be draggable.
Something along the lines of ...
OnMouseDown
startPosition = current position
OnMouseMove
if(MouseButtons.Left)
newPosition = current position
offset = newPosition - startPosition
adjustLocation(offset)
startPosition = newPosition
OnMouseUp/OnMouseLeave
startPosition = Point.Empty
--
Happy Coding!
Morten Wennevik [C# MVP]