With this change in Method GoNextCtrl() your example works fine. Please notice that we use IsWindowEnabled() to check for disabled controls:
- Code: Select all Expand view
- METHOD GoNextCtrl( hCtrl ) CLASS TWindow
local hCtlNext, nAt
if ! Empty( ::aControls ) .and. hCtrl == ::LastActiveCtrl():hWnd .and. ;
! Empty( ::oWnd ) .and. ( ( Upper( ::oWnd:ClassName() ) $ "TFOLDER;TPAGES;TFOLDEREX" ) )
hCtlNext = NextDlgTab( ::oWnd:oWnd:hWnd, ::oWnd:hWnd )
::hCtlFocus = hCtrl
SetFocus( hCtlNext )
else
nAt = AScan( ::aControls, { | o | o:hWnd == hCtrl } )
if nAt != 0
nAt = If( nAt < Len( ::aControls ), nAt + 1, 1 )
while ! lAnd( GetWindowLong( ::aControls[ nAt ]:hWnd, GWL_STYLE ), WS_TABSTOP ) .or. ;
! IsWindowEnabled( ::aControls[ nAt ]:hWnd )
nAt = If( nAt < Len( ::aControls ), nAt + 1, 1 )
end
SetFocus( ::aControls[ nAt ]:hWnd )
endif
endif
return nil