I insert a button on ribbonbar with an action
ACTION ChangeColors( oRBar, { { 0.12, 16777215, 10674091 }, { 0.70, 10674091, 32768 }, { 0.18, 32768, 16777215 } } )
//your function to change color on ribbonbar
function ChangeColors( oRb, aGrad )
local hBmp := GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3,;
oRb:nBottom - oRb:nTopMargin + 1, aGrad )
local n, j, z, oControl
oRb:aGrad := aGrad
DeleteObject( oRb:hBrushEx )
oRb:hBrushEx = CreatePatternBrush( hBmp )
DeleteObject( hBmp )
oRb:Refresh()
for n = 1 to Len( oRb:aDialogs )
DeleteObject( oRb:aDialogs[ n ]:hBack )
oRb:aDialogs[ n ]:hBack = oRb:hBrushEx
if ! Empty( oRb:aDialogs[ n ]:aControls )
for j = 1 to len( oRb:aDialogs[ n ]:aControls )
oControl = oRb:aDialogs[ n ]:aControls[ j ]
if oControl:ClassName() == "TRBGROUP"
DeleteObject( oControl:hBrushUnsel )
oControl:hBrushUnsel = oRb:hBrushEx
DeleteObject( oControl:hBrushSel )
oControl:hBrushSel = nil
endif
next
endif
oRb:aDialogs[ n ]:Refresh()
next
return nil
WHY IT MAKE ERROR ?