Setting the focus to any object
Posted: Fri Feb 23, 2007 12:19 pm
Many questions are posted in FW's forums related to focus.
When oObj:Setfocus() fail, I use this function that work fine for me for many yeara (FW+Clipper / FW+Harbour / FW+xHarbour):
You can call:
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:
You can call the same way xSetFocus():
xFocus( oGet )
xFocus( oBtn )
...
Best regards,
Maurilio
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