When oObj:Setfocus() fail, I use this function that work fine for me for many yeara (FW+Clipper / FW+Harbour / FW+xHarbour):
Code: Select all
function xSetFocus(oObj)
local oTime
define timer oTime interval 10 of oObj:oWnd ;
action (oObj:SetFocus(), oTime:DeActivate())
activate timer oTime
return Nil
xSetFocus( oGet )
xSetFocus( oButton )
xSetfocus( oLbx )
But... in any misterious cases xSetFocus() fail. Then you can call it twice or create a function as below:
Code: Select all
function xFocus(oObj)
xSetFocus(oObj)
xSetFocus(oObj)
return Nil
xFocus( oGet )
xFocus( oBtn )
...
Best regards,
Maurilio