PUBLIC oGradTbr oGradTbr = CREATEOBJECT("GradientToolbar") oGradTbr.addobject("Command1", "CommandButton") oGradTbr.Command1.visible = .T. oGradTbr.addobject("Command2", "CommandButton") oGradTbr.Command2.visible = .T. oGradTbr.addobject("Command3", "CommandButton") oGradTbr.Command3.visible = .T. oGradTbr.Show() DEFINE CLASS GradientToolbar as Toolbar DoPaint = .T. PROCEDURE Paint this.GradientFill ENDPROC PROCEDURE GradientFill *!* Procedure Code slightly modified from a post by Aircon on Tek-Tips *!* http://www.tek-tips.com/viewthread.cfm?qid=778606 Local lnhDC, lnWidth, lnHeight Local lcVertex, lcVert1, lcVert2, lcRect Declare Long GetDC in User32 Long nhWnd Declare Long ReleaseDC in User32 Long nhWnd, Long hDC Declare Long GradientFill in Msimg32 ; Long hDC, String pVertex, Long dwNumVertex, ; String pMesh, Long dwNumMesh, Long dwMode lnhDC = GetDC( this.hWnd ) lnWidth = this.Width lnHeight = this.Height lcVert1 = this.Num2DWord( 0 ) + This.Num2DWord( 0 ) + ; This.Num2Word( 0xFFFF ) + This.Num2Word( 0xFFFF ) + ; This.Num2Word( 0xFFFF ) + This.Num2Word( 0xFFFF ) lcVert2 = This.Num2DWord( lnWidth ) + This.Num2DWord( lnHeight ) + ; This.Num2Word( 0x0000 ) + This.Num2Word( 0x0000 ) + ; This.Num2Word( 0xFF00 ) + This.Num2Word( 0x0000 ) lcVertex = lcVert1 + lcVert2 lcRect = This.Num2DWord( 0 ) + This.Num2DWord( 1 ) GradientFill( lnhDC, lcVertex,2, lcRect,1, 0 ) ReleaseDC( _Screen.hWnd, lnhDC ) Clear Dlls ENDPROC Procedure Num2Word(tnNum) Local lc0, lc1 lc1 = chr(int(tnNum / 256)) lc0 = chr(mod(tnNum, 256)) Return lc0 + lc1 EndProc Procedure Num2DWord(tnNum) Local lc0, lc1, lc2, lc3, lcResult lc3 = chr(int(tnNum / 16777216)) tnNum = mod(tnNum, 16777216) lc2 = chr(int(tnNum / 65536)) tnNum = mod(tnNum, 65536) lc1 = chr(int(tnNum / 256)) lc0 = chr(mod(tnNum, 256)) lcResult = lc0 + lc1 + lc2 + lc3 Return lcResult ENDPROC ENDDEFINE