Fabian vas a tener que modificar la clase Control el método KillFocus agrega TSButton como en este ejemplo :
METHOD KillFocus( hCtlFocus ) CLASS TControl
local oWnd
if ! Empty( hCtlFocus ) .and. ::bValid != nil .and. WndParents( hCtlFocus, ::hWnd ) .and. ;
( oWnd := oWndFromhWnd( hCtlFocus ) ) != nil .and. ;
Upper( oWnd:Classname() ) $ "TBUTTON;TBTNBMP;TSBUTTON" .and. ;
( oWnd:lCancel != nil .and. oWnd:lCancel .and. ;
( ::oWnd:nLastKey != VK_TAB .and. ::oWnd:nLastKey != VK_RETURN .and. ;
::oWnd:nLastKey != VK_DOWN .and. ::oWnd:nLastKey != VK_UP ) ) // JAAM Agregue ";TSBUTTON" para que le haga caso a
::oWnd:lValidating = .t. // la clusula CANCEL en los botones
::oWnd:nLastKey := 0
::ForWhen()
::oWnd:lValidating = .f.
::LostFocus()
return nil
else
if Upper( GetClassName( hCtlFocus ) ) == "TBTNBMP"
::oWnd:nLastKey := 0 // it fixes TBtnBmp CANCEL clause
endif
endif
// in FiveWin++ lValidating comes as nil sometimes
if ! Empty( hCtlFocus ) .and. ( ::oWnd:lValidating == nil .or. ! ::oWnd:lValidating ) ;
.and. IsWindowVisible( ::oWnd:hWnd ) .and. WndParents( hCtlFocus, ::hWnd )
PostMessage( ::hWnd, FM_LOSTFOCUS, hCtlFocus )
endif
return ::LostFocus( hCtlFocus )
Saludos
Joel Andujo