Despues de muchos intentos una mejor solucion es usar btnFlat en vez say . Para ello he implementado el methodo redefine en la clase btnflat :
METHOD ReDefine( nId, bAction, oWnd, oFont, ;
lUpdate, bWhen, bValid, cPrompt, lBorder,;
nClrText, nClrPane, lCancel, lDefault ) CLASS TBtnFlat
DEFAULT lBorder := .F., ;
nClrText := CLR_WHITE, nClrPane := CLR_BLUE, ;
lCancel := .F. , lDefault := .F.
DEFAULT oWnd := GetWndDefault()
::nStyle = nOR( WS_CHILD, WS_VISIBLE, WS_TABSTOP, If( lDefault, BS_DEFPUSHBUTTON, 0 ) )
::nId = nId
::bAction = bAction
if oFont == nil
::GetFont()
else
::SetFont( oFont )
endif
::oWnd = oWnd
::lUpdate = lUpdate
::bWhen = bWhen
::bValid = bValid
::cCaption = cPrompt
::lCancel = lCancel
::nClrText = nClrText
::nClrPane = nClrPane
::lBorder = lBorder
::lDefault = lDefault
::lPressed = .F.
::lBtnDown = .F.
::lBtnUp = .F.
::lWorking = .F.
::lTransparent = .F.
::nDlgCode = DLGC_WANTALLKEYS
::Register( nOR( CS_VREDRAW, CS_HREDRAW ) )
oWnd:DefControl( Self )
return Self
y su include correspondiente :
#xcommand REDEFINE FLATBTN [<oBtn>] ;
[ ID <nId> ] ;
[ ACTION <uAction,...> ] ;
[ <of:OF, WINDOW, DIALOG> <oWnd> ] ;
[ VALID <uValid> ] ;
[ WHEN <uWhen> ] ;
[ <lUpdate: UPDATE> ] ;
[ PROMPT <cPrompt> ] ;
[ COLOR <nClrText>, <nClrPane> ] ;
[ FONT <oFont> ] ;
[ <lNoBorder: NOBORDER> ] ;
[ <lCancel: CANCEL> ] ;
[ <lDefault: DEFAULT> ] ;
=> ;
[ <oBtn> := ] TBtnFlat():Redefine( <nId>,;
[{|Self|<uAction>}], <oWnd>, <oFont>, <.lUpdate.>,<{uWhen}>, <{uValid}>,;
<cPrompt>, !<.lNoBorder.>, <nClrText>, <nClrPane>, <.lCancel.>, <.lDefault.> )
He hecho un pequeño test y funciona bien con los recursos button ...