I couldn't detect anything wrong on panel-brushpainting.
// at startup
// ------------
IF cBrush = "C" // color
  oPanel1:SetColor( "W/R" )
  oPanel2:SetColor( "W/G" )
  oPanel3:SetColor( "W/B" )
ELSE // gradient, brush, image
  PANELBRUSH( oPanel1, 1, cBrush )
  PANELBRUSH( oPanel2, 2, cBrush )
  PANELBRUSH( oPanel3, 3, cBrush )
ENDIF
// ---- on button-action
@ 110, nBtnleft button "Gradient" size 130, 40 pixel ;
ACTION (Â Â cBrush := "G", ;
  PANELBRUSH( oPanel1, 1, cBrush, , oPanel1:nHeight ), ;
  PANELBRUSH( oPanel2, 2, cBrush, , oPanel2:nHeight ), ;
  PANELBRUSH( oPanel3, 3, cBrush, , oPanel3:nHeight ) ) ;
OF oWnd
// ------------
FUNCTION PANELBRUSH( oPanel, nPanel, cBrush, cImage, nHeight )
LOCAL hDC, hBmp, hBmpOld, oBrush
LOCAL aRect := GETCLIENTRECT( oPanel:hWnd )
LOCAL aColors Â
IF cBrush = "C" .or. cBrush = "G" // colors used for defined color- and gradient-background
  IF nPanel = 1
    aColors := { { 1, 16777215, 255 } }
  ELSEIF nPanel = 2
    aColors := { { 1, 16777215, 32768 } }
  ELSEIF nPanel = 3
    aColors := { { 1, 16777215, 16711680 } }
  ENDIF
ENDIF
IF cBrush = "G"
  // MsgAlert( nHeight, "Panel-height" )
  hDC = CREATECOMPATIBLEDC( oPanel:GetDC() )
  hBmp = CREATECOMPATIBLEBITMAP( oPanel:hDC, oPanel:nWidth, nHeight )
  hBmpOld = SELECTOBJECT( hDC, hBmp )
  GRADIENTFILL( hDC, 0, 0, oPanel:nHeight, oPanel:nWidth, aColors )
  oBrush = TBrush():New( ,,,, hBmp )
  oPanel:SetBrush( oBrush )
  AEVAL( oPanel:aControls, { | oCtl | If( oCtl:lTransparent, oCtl:SetBrush( oPanel:oBrush ), ) } )
  RELEASE BRUSH oBrush
  SELECTOBJECT( hDC, hBmpOld )
  DELETEDC( hDC )
  oPanel:ReleaseDC()
ENDIF
IF cBrush = "B"
  DEFINE BRUSH oBrush FILE cImage
  oPanel:SetBrush( oBrush )
  AEVAL( oPanel:aControls, { | oCtl | If( oCtl:lTransparent, oCtl:SetBrush( oPanel:oBrush ), ) } )
  RELEASE BRUSH oBrush
ENDIF
IF cBrush = "I"
  DEFINE IMAGE oImage FILE cImage
  oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, aRect[4], aRect[3], .T. ) )
  oImage:End()
  oPanel:SetBrush( oBrush )
  AEVAL( oPanel:aControls, { | oCtl | If( oCtl:lTransparent, oCtl:SetBrush( oPanel:oBrush ), ) } )
  RELEASE BRUSH oBrush
ENDIF
RETURN NIL