Forum Discussion
tristaanogre
9 years agoEsteemed Contributor
If the only method of doing so for an actual end user is to "drag", then your only other recourse is to somehow exploit native methods, properties, etc., to do the same thing. And that's probably a lot harder than just using drag.
However, the problem with the "Drag" method as it is comes from the fact that the parameters don't allow you to just say, "Drag from object one to object 2". Well... there's a solution.
Not that long ago, someone posted here a bit of code that will take two onscreen objects and execute a drag of one to another. You can give this a shot and see if it helps.
function dragCalculatedDistance(startObject, destinationObject) {
var startPoint, targetPoint, dragX, dragY;
// Drag from the center of object A to the center of object B
startPoint = startObject.WindowToScreen(startObject.Width/2, startObject.Height/2);
targetPoint = destinationObject.WindowToScreen(destinationObject.Width/2, destinationObject.Height/2);
dragX = targetPoint.X - startPoint.X;
dragY = targetPoint.Y - startPoint.Y;
startObject.Drag(-1, -1, dragX, dragY);
}