Jump to content
Fivewin Brasil

xSetFocus


mkyx

Recommended Posts

Bom dia,

Alguém tem um função que focaliza um campo GET, com bastante "força", porque uso a função xSetFocus abaixo, mas, dependendo da situação, o funcionamento 100% desta função fica intermitente.

FUNCTION xSetFocus(oObj)
Local oTempo_1
Define Timer oTempo_1 Interval 5 of oObj:oWnd action (oObj:setfocus(),oObj:setpos(0),oObj:setfocus(),oTempo_1:Deactivate())
Activate Timer oTempo_1
return .t.
 

Obrigado.

 

Link to comment
Share on other sites

Só uso ela:

//-------------------------------------------------------------------------//
// As vezes simples SetFocus( oObj ) nao faz um objeto ganhar foco
// neste caso pode apelar para estas duas funcoes a seguir
// Forcar foco para um objeto especifico - Ednaldo Rolim...
//-------------------------------------------------------------------------//
FUNCTION xFocus( oObj )
	   xSetFocus( oObj )
   xSetFocus( oObj )
	RETURN( .T. )
	FUNCTION xSetFocus( oObj )    
	   LOCAL _oWnd := oObj:oWnd, _oTempo := ""
	   DEFINE TIMER _oTempo INTERVAL 10 OF _oWnd ;
          ACTION ( oObj:SetFocus(), _oTempo:End() )
	   ACTIVATE TIMER _oTempo
RETURN( .T. )

Regards, saludos.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...