oApp = CREATEOBJECT([MyApplication]) oForm = CREATEOBJECT([Test]) oForm.Show() oForm1 = CREATEOBJECT([Test]) oForm1.Show() READ EVENTS ************************************************** *-- Form: test (d:\all_zapl\test.scx) *-- ParentClass: form *-- BaseClass: form *-- Time Stamp: 03/11/06 07:29:05 PM * DEFINE CLASS Test AS form DoCreate = .T. Caption = "Form" test = .F. Name = "Test" PROCEDURE Init oApp.ShowToolBar() ENDPROC PROCEDURE Resize IF this.WindowState = 1 oApp.RemoveToolBar() ELSE oApp.ShowToolBar() ENDIF ENDPROC PROCEDURE Destroy oApp.RemoveToolBar() CLEAR EVENTS ENDPROC ENDDEFINE * *-- EndDefine: test ************************************************** DEFINE CLASS MyApplication AS Custom nShowToolBar = 0 oToolBar = NULL PROCEDURE ShowToolBar IF ISNULL(this.oToolBar) this.oToolBar = CREATEOBJECT([ToolBar]) this.oToolBar.AddObject([Command1],[CommandButton]) this.oToolBar.Command1.Visible = .t. this.oToolBar.Show() ENDIF this.nShowToolBar = this.nShowToolBar + 1 ENDPROC PROCEDURE RemoveToolBar this.nShowToolBar = this.nShowToolBar - 1 IF this.nShowToolBar < 1 this.oToolBar = NULL ENDIF ENDPROC ENDDEFINEIn that example if you close any of the forms you issue CLEAR EVENTS ;o)))