ayuda en busquedas
Hola a todos
bueno estoy empezando a trabajar con VF 8.0 y veo que en la ventana de comando cuando tecleas instrucciones te despega un tipo de combobox donde te da las opciones que puedes seleccionar
mi pregunta es como puedo hacer eso en un textbox de una forma??
bueno espero que me puedan ayudar
y de ante mano muchas gracias
Saludos
bueno estoy empezando a trabajar con VF 8.0 y veo que en la ventana de comando cuando tecleas instrucciones te despega un tipo de combobox donde te da las opciones que puedes seleccionar
mi pregunta es como puedo hacer eso en un textbox de una forma??
bueno espero que me puedan ayudar
y de ante mano muchas gracias
Saludos
este codigo me funciona en VFP 6.0
En el evento KeyPress:
IF LASTKEY()=13
xenter=.T.
wven=vendedor.ncodigo
vend=vendedor.codigo
store space(40) to venbus
WITH THISFORM
.text6.REFRESH
.container1.text5.REFRESH
.container1.text5.VISIBLE=.T.
.container1.text5.tabstop=.f.
.container1.text8.VISIBLE=.F.
.container1.label3.VISIBLE=.T.
.container1.list1.VISIBLE=.F.
ENDWITH
ELSE
THISFORM.container1.list1.VISIBLE=.T.
xenter=.F.
ENDIF
En el evento gotfocus:
STORE SPACE(40) TO VENBUS &&variable
xenter=.f. &&variable que maneja el Enter
En el evento InteractiveChange del textbox usas este codigo:
LOCAL nindex
FOR nindex=1 TO THISFORM.CONTAINER1.list1.LISTCOUNT
IF SUBSTR(UPPER(THISFORM.CONTAINER1.list1.LISTITEM(nindex)),1,LEN(UPPER(ALLTRIM(THIS.VALUE))))=UPPER(ALLTRIM(THIS.VALUE))
THISFORM.CONTAINER1.list1.LISTINDEX=nindex
EXIT
ENDIF
ENDFOR
THISFORM.CONTAINER1.list1.REFRESH
Y en el evento LostFocus:
WITH THISFORM
.container1.text9.REFRESH
.container1.text9.VISIBLE=.T.
.container1.text9.SETFOCUS
ENDWITH
acomoda las variables y container a yu gusto.
espero te sirva
Raul
En el evento KeyPress:
IF LASTKEY()=13
xenter=.T.
wven=vendedor.ncodigo
vend=vendedor.codigo
store space(40) to venbus
WITH THISFORM
.text6.REFRESH
.container1.text5.REFRESH
.container1.text5.VISIBLE=.T.
.container1.text5.tabstop=.f.
.container1.text8.VISIBLE=.F.
.container1.label3.VISIBLE=.T.
.container1.list1.VISIBLE=.F.
ENDWITH
ELSE
THISFORM.container1.list1.VISIBLE=.T.
xenter=.F.
ENDIF
En el evento gotfocus:
STORE SPACE(40) TO VENBUS &&variable
xenter=.f. &&variable que maneja el Enter
En el evento InteractiveChange del textbox usas este codigo:
LOCAL nindex
FOR nindex=1 TO THISFORM.CONTAINER1.list1.LISTCOUNT
IF SUBSTR(UPPER(THISFORM.CONTAINER1.list1.LISTITEM(nindex)),1,LEN(UPPER(ALLTRIM(THIS.VALUE))))=UPPER(ALLTRIM(THIS.VALUE))
THISFORM.CONTAINER1.list1.LISTINDEX=nindex
EXIT
ENDIF
ENDFOR
THISFORM.CONTAINER1.list1.REFRESH
Y en el evento LostFocus:
WITH THISFORM
.container1.text9.REFRESH
.container1.text9.VISIBLE=.T.
.container1.text9.SETFOCUS
ENDWITH
acomoda las variables y container a yu gusto.
espero te sirva
Raul
