*Add button on the fly thisform.NewObject('onthefly','myCommandButton','mybutton.prg') with thisform.onthefly .tag = sys(2015) set textmerge to (.tag+'.prg') noshow set textmerge on \lparameters toForm \wait window toForm.Name set textmerge to set textmerge off compile (.tag+'.prg') endwith * MyButton.prg define class myCommandButton as CommandButton procedure Click do (this.tag) with thisform endproc procedure destroy erase (this.tag+'.*') endproc enddefineCetin