public oTest oTest = createobject("remobj") oTest.Show() DEFINE CLASS obj AS container Width = 145 Height = 159 Name = "obj" ADD OBJECT command1 AS commandbutton WITH ; Top = 6, ; Left = 6, ; Height = 144, ; Width = 132, ; Caption = "Remove Parent", ; Name = "Command1" PROCEDURE command1.Click this.parent.visible = .f. this.parent.parent.removeobject(this.parent.name) ENDPROC ENDDEFINE DEFINE CLASS remobj AS form Top = 0 Left = 0 Height = 185 Width = 172 DoCreate = .T. Caption = "Form2" Name = "remobj" ADD OBJECT obj1 AS obj WITH ; Top = 12, ; Left = 12, ; Name = "Obj1", ; Command1.Name = "Command1" ENDDEFINE