Move control/object at run-time

How to move any object Run Time


i have create one window
add three text control
& run it
after run i have to change possition the text object with mouse.

any one can do this task.


Hi Tushar,

Check this thread from the old forum:


Julien beat me to a response, but if you want to see something very very quick and dirty, this code will turn a text box into a draggable one and back again, by clicking on it.

Click once to start moving, click again to stop.

Add a class to your project.
Name it DraggableTextField
Set the Class to inherit from TextField.

Add these properties:

Dragging as boolean Startx as integer starry as integer

Add this to the MouseDown event:

startx= x starty = y dragging = not dragging return true

add this to the mouse move event:

if dragging then me.left = me.left + x-startx = + y-starty end if

add this to the mouse exit event (to handle loss of mouse due to rapid movement

dragging = false

Finally, add a text field to a window.
Change its super to DraggableTextField
Run and test.