PUBLIC goToolbar goToolbar = CREATEOBJECT("BorderlessToolbar") goToolbar.Show() DEFINE CLASS BorderlessToolbar as Toolbar PROCEDURE Init() *!* Set up some objects for the toolbar and give us an exit button this.AddObject("Command1", "Commandbutton") this.command1.visible = .T. this.AddObject("Command2", "Commandbutton") this.command2.visible = .T. this.AddObject("Command3", "Exitbutton") this.command3.visible = .T. this.SetAll("Height", 22) ENDPROC PROCEDURE Show LPARAMETERS nStyle IF DODEFAULT(nStyle) this.Resize() ENDIF ENDPROC PROCEDURE Resize this.SetDisplayRegion(3, SYSMETRIC(9) - 5, this.Width + 3, this.Height + SYSMETRIC(9) - 4) ENDPROC PROCEDURE AfterDock LPARAMETERS nLocation, oForm this.SetDisplayRegion(0, 0, this.Width, this.Height) ENDPROC PROCEDURE Undock LOCAL lnDockPosition lnDockPosition = this.DockPosition IF INLIST(lnDockPosition, 0, 3) this.SetDisplayRegion(3, SYSMETRIC(9) - 5, this.Width - 5, this.Height+ SYSMETRIC(9) - 5) ELSE this.SetDisplayRegion(3, SYSMETRIC(9), this.Width + 1, this.Height + SYSMETRIC(9) - 13) ENDIF ENDPROC PROCEDURE SetDisplayRegion(tnX1, tnY1, tnX2, tnY2) DECLARE INTEGER DeleteObject IN gdi32 INTEGER hObject DECLARE INTEGER CreateRectRgn IN gdi32; INTEGER X1, INTEGER Y1, INTEGER X2, INTEGER Y2 DECLARE INTEGER SetWindowRgn IN user32 ; INTEGER HWND, INTEGER hRgn , INTEGER bRedraw RegiondeLinea = CreateRectRgn(tnX1, tnY1, tnX2, tnY2) SetWindowRgn(This.Hwnd, RegiondeLinea, 1) DeleteObject(RegiondeLinea) ENDPROC ENDDEFINE DEFINE CLASS ExitButton as CommandButton Caption = "Exit Toolbar" PROCEDURE Click this.Parent.release() ENDPROC ENDDEFINE