PUBLIC oForm oForm = CREATEOBJECT('form1') oForm.visible = .t. ************************** DEFINE CLASS form1 AS form Height = 333 Width = 480 ShowWindow = 2 DoCreate = .T. AutoCenter = .T. Caption = "Form1" toolbarref = .NULL. Name = "Form1" ADD OBJECT command1 AS commandbutton WITH ; Top = 200, ; Left = 290, ; Height = 27, ; Width = 84, ; Caption = "Command1", ; Name = "Command1" ADD OBJECT command2 AS commandbutton WITH ; Top = 200, ; Left = 198, ; Height = 27, ; Width = 84, ; Caption = "Command2", ; Name = "Command2" ADD OBJECT command3 AS commandbutton WITH ; Top = 200, ; Left = 106, ; Height = 27, ; Width = 84, ; Caption = "Command3", ; Name = "Command3" ADD OBJECT text1 AS textbox WITH ; Height = 23, ; Left = 32, ; Top = 28, ; Width = 424, ; Name = "Text1" PROCEDURE Activate IF ISNULL(this.toolbarref) this.ToolbarRef=CREATEOBJECT('MyToolbar') this.ToolbarRef.Dock(0) && or 1 , 2 this.ToolbarRef.visible = .t. ENDIF ENDPROC ENDDEFINE ********************************* DEFINE CLASS mytoolbar AS toolbar Caption = "Toolbar1" Height = 28 Left = 0 Top = 0 Width = 99 ShowWindow = 1 Name = "mytoolbar" ADD OBJECT command1 AS commandbutton WITH ; Top = 3, ; Left = 5, ; Height = 22, ; Width = 23, ; Caption = "a", ; Name = "Command1" ADD OBJECT command2 AS commandbutton WITH ; Top = 3, ; Left = 27, ; Height = 22, ; Width = 23, ; Caption = "b", ; Name = "Command2" ADD OBJECT command3 AS commandbutton WITH ; Top = 3, ; Left = 49, ; Height = 22, ; Width = 23, ; Caption = "c", ; Name = "Command3" ADD OBJECT command4 AS commandbutton WITH ; Top = 3, ; Left = 71, ; Height = 22, ; Width = 23, ; Caption = "d", ; Name = "Command4" ENDDEFINE