Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Refreshing shapes
Message
 
 
À
24/08/2005 13:09:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01043393
Message ID:
01043482
Vues:
10
>Hi Naomi, thanks for the response. When the code is run the error message I get is "Expression is not valid outside of WITH/ENDWITH. When this happens, the cursor is stuck at .curvature.

Looks like it doesn't like the with thisform.controls[thisform.controlcount]

Let's try slightly different approach. Create new property called nLastShapeNumber and set it to 0 in property sheet.

Then change your code to
>>* Right click code
>>
>>Parameters nXCoord,nYCoord
>> local lnX, lnY, loShapeObject
>>Count To Locations
>>
>>If Locations < 1
>>	Return
>>Endif
>>
>>For SpotToRefresh = 1 To Locations
>>	Goto SpotToRefresh
>>	lnX = XX
>>	lnY = YY
>>	If nButton = 1
>>		If Sys(1270)=m.this
                        thisform.nLastShapeNumber = thisform.nLastShapeNumber + 1

>>			Thisform.AddObject( "shp" + transform(thisform.nLastShapeNumber), "shape")
                        loShapeObject = evaluate("thisform.shp" + transform(thisform.nLastShapeNumber))
>>			With loShapeObject
>>	                        .Move(lnX,lnY,25,25)
>>				.Curvature = 99
>>				.BackColor = 255
>>				.BackStyle = 1
>>				.BorderWidth = 2
>>				.BorderColor = 65535
>>				.SpecialEffect = 0
>>				.ToolTipText = "Crime scene"
>>				.Visible = .T.
>>			Endwith
>>		Endif
>>	Endif
>>Next SpotToRefresh
>>

Also try this code not from the right click, but from some button's click. Once it's working, we'll try to move it to Right click.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform