When draggin an object in a canvas how can I get the mouse x, y where it was released ?
DragItem.left and DragItem.top give me the coordinates of the contourn object but the object dragged may had been selected in different places of itself, so DragItem.Width give me the size of the object but no where the mouse is dragging it.
reading error, sorry.
[quote=429230:@Enric Herrera]When draggin an object in a canvas how can I get the mouse x, y where it was released ?
DragItem.left and DragItem.top give me the coordinates of the contourn object but the object dragged may had been selected in different places of itself, so DragItem.Width give me the size of the object but no where the mouse is dragging it.[/quote]
When the drag starts, figure out the distance from the given x and y points to the left and top of the object. Store them in properties until the user drops and then subtract those values from the drop x and y. Thats where you place the object.
I found the solution
Window1.MouseX, Window1.MouseY
return the mouse position where the object is dropped, you must then take in consideration the position of the canvas in the window and add those top & left values