loForm = CREATEOBJECT('myForm') loForm.Show(1) DEFINE CLASS myForm as Form width = 603 height = 100 myObjects = 20 ADD OBJECT cmdRemove as CommandButton WITH Left = 260, Top = 80, Width = 60, Caption = 'Remove!' FUNCTION Init() as Boolean LOCAL lnObject, loText FOR lnObject = 1 TO thisform.myObjects thisform.NewObject('txt' + TRANSFORM(lnObject, '@L 999'), 'TextBox') WITH GETPEM(thisform, 'txt' + TRANSFORM(lnObject, '@L 999')) .Width = 30 .Left = ((lnObject - 1) * .Width) + 1 .Top = 5 .Value = lnObject .Visible = .t. ENDWITH ENDFOR RETURN .T. ENDFUNC PROCEDURE RemoveButtons() as VOID FOR lnObject = 1 TO thisform.myObjects thisform.RemoveObject('txt' + TRANSFORM(lnObject, '@L 999')) ENDFOR RETURN NULL ENDPROC PROCEDURE cmdRemove.Click() as VOID thisform.RemoveButtons() RETURN NULL ENDPROC ENDDEFINE