Hi Hee,
>if i drag the button to new x,y position than release the clik
>the button still back to it's original position
>so how to make the button stay at the new position ?
Suppose that you will move an object within a form. So, you can to do thus:
- Set DragMode property to 1 (Automatic).
- Create two properties, one called "nDifXCoord" and another called "nDifYCoord". These names can to be different but with this you shuld they in code below.
- Put the code below in MouseMove event of your object. Leave there the "LParameters" line that appear automatically.
thisForm.nDifXCoord = nXCoord - THIS.Left
thisForm.nDifYCoord = nYCoord - THIS.Top
- Put the code below in DragDrop event of your form. Leave there the "LParameters" line that appear automatically.
oSource.Left = nXCoord - thisForm.nDifXCoord
oSource.Top = nYCoord - thisForm.nDifYCoord
I hope this help you.
Erick
Força Sempre!
Strength Always!