for each oControl in thisform.controls if upper(oControl.Baseclass) = 'SHAPE' * If all shapes from same class * if upper(oControl.Class) = 'MYCLASS' with oControl * Do whatever :ie * .BackColor = myColor(.Name) endwith endif endforAnother simple approach is to use a class with _assign property.
define class myShape as Shape ChangeColor=.f. Status ='' procedure SetColor lparameters tcParam * Set color based on passed param. ie: if this.Status == substr(tcParam,1, at('-',tcParam)-1) this.Backcolor = eval(substr(tcParam,at('-',tcParam)+1)) endif endproc Procedure ChangeColor_assign lparameters vNewVal this.SetColor(vNewVal) endproc endproc enddefineYou could invoke color change of all shpaes from this class by simply calling :