Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to drag and move command buttons inside a form
Message
From
15/09/2007 10:18:43
Erick Miranda
Formata Data Business - Grupo Linx
Contagem, Brazil
 
 
To
15/09/2007 03:28:12
Hee Lim Wang
Fantasy Software Enterprise
Malaysia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01254261
Message ID:
01254538
Views:
19
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!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform