The Drag Auto property determines whether PowerBuilder puts the control into drag mode automatically. If the property is enabled, when the user clicks the control and starts dragging it, PowerBuilder puts the control in drag mode. Clicking the control triggers a DragDrop event, not a Clicked event.
If Drag Auto is not enabled, then when the user clicks the control, PowerBuilder does not put the control in drag mode. You have to call the Drag function to put the control into drag mode.
In the Window, put 1 Picture object, and set the name of the file, and turn on the DragAuto option, in other tabs of property, and named it as p_1
Add the following script in p_1's clicked event
At the p_1's dragleave event, put this following script:
this.x = parent.pointerx( ) - (this.width / 2)
this.y = parent.pointery( ) - (this.height / 2)
And finally, at p_1's dragdrop event, add this following script: