ofrm1=CREATEOBJECT("testform") WITH ofrm1 .addobject("cmdbutton1","cmdbutton") .cmdbutton1.visible=.t. .show(1) ENDWITH DEFINE CLASS cmdbutton AS CommandButton && Create Command button Top = 141 Left = 331 Height = 51 Width = 175 Caption = "Command1" Name = "Command1" PROCEDURE Click ofrm2=CREATEOBJECT("testform") ofrm2.show(1) ENDDEFINE DEFINE CLASS testform AS form Top = 0 Left = 0 Height = 432 Width = 670 DoCreate = .T. Caption = "Form1" Name = "Form1" PROCEDURE Resize IF this.WindowState= 1 MOVE WINDOW (this.Name) TO 1,1 ENDIF ENDPROC ENDDEFINE