>How can I create a label to be used on a main static form and the caption be defined in another from or program on the fly?
If you have a reference to 'main' form you could do that. To have the reference simple way is to use name clause :
public frmMain
do form mainForm name frmMain
* Anywhere then : frmMain.myLabel.Caption = 'MyCaption'
Probably instead of public you'd want to use oApp custom object as storage.
If you didn't create it that way then you might still find it browsing the form objects (something like):
for ix=1 to _vfp.objects.count
with _vfp.objects(m.ix)
if lower(.baseclass) == 'form' and ;
sys(1271,_vfp.objects(m.ix)) = mySCXName
.myCaption = 'Caption'
endif
endwith
endfor
Cetin