Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moving shapes in run time
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00691580
Message ID:
00691748
Vues:
15
>Thanks Nick!

Hi Adrian,

All you need to be able to move your shape at runtime with the mouse is this code in shape.MouseMove()
*** MouseMove()
LPARAMETERS nButton, nShift, nXCoord, nYCoord
IF nButton = 1 && 1-left button, 2-right button
	WITH THIS
		.DRAG()
		.LEFT =  .LEFT + MCOL(THISFORM.NAME, 3) - nXCoord
		.TOP  =  .TOP  + MROW(THISFORM.NAME, 3) - nYCoord
	ENDWITH
ENDIF
Optionally you can add the code which remembers the positions.
Note also, that if you move the shape within a container, you might leave it at the position which will be outside the container borders, thus putting it out of sight. You might need to add some code to prevent such situations.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform