Page 1 of 1

Como puedo regresar el foco a un get ??

Posted: Thu Apr 17, 2008 2:27 am
by gabo
Tengo el siguiente codigo donde uso un get

Code: Select all

   REDEFINE GET oGets[8] VAR hVars["CLAVE"] ID 706 OF oDlgChild 
   oGets[8]:bKeyDown:= { |nKey| IIF( nKey == VK_RETURN, ;
   ( ChkArticulos( oGets[8], hVars["CLAVE"] ), 1 ) , 0 ) }

   REDEFINE BUTTONBMP oBotons[2] ID 716  OF oDlgChild;
            ACTION ( AddItemToBrowse(aDetalle, hVars, oGets), ;
                     oBrwDetalle:Refresh(), oGets[8]:SetFocus(), oGets[8]:Refresh() ) ;
            BITMAP "BMP_ADD_ITEM"
En el botonbmp grabo datos en un browse y refresco, despues se supone que debe de regresar al GET anterior y no lo hace! me pueden orientar y decirme donde puede estar mi error !

Sin embargo si le pongo un MsgStop() antes de poner el foco en el get, si lo regresa el foco al get

Code: Select all

REDEFINE BUTTONBMP oBotons[2] ID 716  OF oDlgChild;
            ACTION ( AddItemToBrowse(aDetalle, hVars, oGets), ;
                     oBrwDetalle:Refresh(), MsgStop("hola"), oGets[8]:SetFocus(), oGets[8]:Refresh() ) ;
            BITMAP "BMP_ADD_ITEM"
Saludos
GABO

Posted: Thu Apr 17, 2008 2:54 am
by Ale SB
Amigo tente usar apos el get:refresh,

oDlg:Update()

Saluds

Posted: Thu Apr 17, 2008 8:53 am
by Antonio Linares
Gabo,

Prueba asi:

Code: Select all

REDEFINE BUTTONBMP oBotons[2] ID 716  OF oDlgChild; 
            ACTION ( AddItemToBrowse(aDetalle, hVars, oGets), ; 
                     oBrwDetalle:Refresh(), MsgStop("hola"), oBotons[2]:oJump := Gets[8], oGets[8]:Refresh() ) ; 
            BITMAP "BMP_ADD_ITEM"

Posted: Thu Apr 17, 2008 1:54 pm
by gabo
Gracias antonio:
pero no funciono.. sigue igual no pasa el foco al get, lo unico que hago es un refresh de un xbrowse..
saludos

Posted: Thu Apr 17, 2008 4:42 pm
by antolin
Intenata:

PostMessage(oGets[8]:hWnd, WM_SETFOCUS)

o

PostMessage(oGets[8]:hWnd, FM_CHANGEFOCUS)

Posted: Thu Apr 17, 2008 7:27 pm
by gabo
Antolin,

gracias!!!

funciono perfecto!!

Saludos
GABO