Problema con los focus()

Problema con los focus()

Postby Loren » Wed Oct 17, 2007 4:23 pm

estimados compañeros:

Expongo un caso algo raro con los setfocus:

Tengo un Dialog con 5 gets (del 1 al 5 y en el 5º hace una validación) y necesito que cuando el usuario cumplimente los 5 gets (del 1 al 5), el foco haga solo el recorrido del 3 al 5 sucesivamente.

Lo he intentado haciendo:
....
redefine get oget1 var cget1 id 101 of odlg picture '9999999.99'
redefine get oget2 var cget2 id 102 of odlg picture '9999999.99'
redefine get oget3 var cget3 id 103 of odlg picture '9999999.99'
redefine get oget4 var cget4 id 104 of odlg picture '9999999.99'
redefine get oget5 var cget5 id 105 of odlg picture '9999999.99' valid(validar())
....
funct validar()
total+=cget2*cget3
oget3:setfocus(.t.)
return .t.

En el RC todos los GETS tienen activado el TABSTOP, pero de esta manera no va.... sin embargo si inserto un msginfo en validar() funciona!! Siempre se situa en el oget1 por defecto.
Tambien probé con oget5:bkeydown := {|nKey| iif(nKey==VK_RETURN, oget3:setfocus(.T.),)}
pero tampoco funciona!!

¿ Como lo consigo ? Mil gracias.
LORENZO
Loren
 
Posts: 479
Joined: Fri Feb 16, 2007 10:29 am
Location: Cadiz - España

Postby Antonio Linares » Wed Oct 17, 2007 4:54 pm

Prueba asi:

funct validar()
total+=cget2*cget3
oGet5:oJump = oGet3
return .t.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Loren » Wed Oct 17, 2007 6:16 pm

Gracias Master.... funcionó perfectamente!!

Mil gracias de nuevo.
Loren
 
Posts: 479
Joined: Fri Feb 16, 2007 10:29 am
Location: Cadiz - España


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 86 guests