I add a variable lNoBorderBtn and I create a ButtonBmp when it is .f. and a BtnBmp with it is .t., now it works ok in both cases.
Thanks for your help Antono!!
For those who could need this I leave the code:
After defining a variable lNoBorderBtn in method New and Redefine.....
METHOD CreateButton() CLASS TGet
local oThis := Self
if ValType( ::bAction ) == "B" .and. Upper( ::ClassName() ) == "TGET"
//JSe modifica para que al indicar que no se desee borde en botón cambie a objeto btnbmp sin borde
IF ::lNoBorderBtn
IF Empty( ::cBmpName ) //no hay bmp
@ 0, ::nWidth - ::nHeight BUTTONBMP ::oBtn OF Self ;
ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
SIZE ::nHeight - 4, ::nHeight - 4 PIXEL TRANSPARENT
::oBtn:SetText( "..." )
ELSE
/*
@ 0, ::nWidth - ::nHeight BUTTONBMP ::oBtn OF Self ;
ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
SIZE ::nHeight - 4, ::nHeight - 4 PIXEL BITMAP ::cBmpName
*/
IF At( ".", ::cBmpName)<>0 //si es .bmp
@0, ::nwidth - ::nHeight BTNBMP ::oBtn OF Self;
ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
FILE ::cBmpName ;
SIZE ::nHeight - 4, ::nHeight - 4 PIXEL NOBORDER TRANSPARENT
ELSE //si es un bmp
@0, ::nwidth - ::nHeight BTNBMP ::oBtn OF Self;
ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
RESOURCE ::cBmpName;
SIZE ::nHeight - 4, ::nHeight - 4 PIXEL NOBORDER TRANSPARENT
ENDIF
ENDIF
ELSE
if Empty( ::cBmpName )
@ 0, ::nWidth - ::nHeight BUTTONBMP ::oBtn OF Self ;
ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
SIZE ::nHeight - 4, ::nHeight - 4 PIXEL
if Empty( ::oBtn:hBitmap )
::oBtn:SetText( "..." )
endif
else
@ 0, ::nWidth - ::nHeight BUTTONBMP ::oBtn OF Self ;
ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
SIZE ::nHeight - 4, ::nHeight - 4 PIXEL BITMAP ::cBmpName
endif
ENDIF
::oBtn:lCancel = .T. // so the GET VALID is not fired when the button is focused
ENDIF
return nil
//----------------------------------------------------------------------------//