Visual Basic - UTILIZAR INTRO EN LUGAR DE TAB (URGENTE)

Life is soft - evento anual de software empresarial
 
Vista:

UTILIZAR INTRO EN LUGAR DE TAB (URGENTE)

Publicado por KONTXI (47 intervenciones) el 25/05/2001 10:27:19
HOLA TENGO UN PEQUEÑO PROBLEMILLA. CON EL SIGUIENTE CÓDIGO :

Private Sub Text5_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
Text3.SetFocus
End If

End Sub

LO QUE QUIERO ES PODER PASAR DE UN OBJETO A OTRO UTILIZANDO EL INTRO EN LUGAR DEL TAB.

PERO LO QUE PASA ES QUE A VECES NO QUIERO QUE RECIBA EL FOCO UNA CAJA DE TEXTO SINO UNA COMBOBOX, Y ESTE NO TIENE EL EVENTO SETFOCUS, Y CON EL GOTFOCUS TAMBIEN DA ERROR. ¿ALGUIEN SABRÍA COMO SOLUCIONARLO? SEGURO QUE SI.

MUCHAS GRACIAS POR ADELANTADO. KONTXI.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:UTILIZAR INTRO EN LUGAR DE TAB (URGENTE)

Publicado por Miguel (243 intervenciones) el 25/05/2001 11:54:48
Hola.
Una forma sencilla de hacerlo es :
Pones el KeyPreview del Form a True y ordenas el TabIndex de todos los controles como quieras y en el evento KeyPress del Form pones

If keyascii = 13 Then ' enter
SendKeys "{TAB}"
Keyascii=0 ' para que no pite
End If

De esta manera no tienes que poner el código en cada control.

Saludos

Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

GRACIAS

Publicado por KONTXI (47 intervenciones) el 25/05/2001 12:17:10
MUCHAS GRACIAS, YA HABÍA RESUELTO EL PROBLEMA, PERO TU SOLUCIÓN ES MUCHO MEJOR, YA QUE YO HE TENIDO QUE PONER EL CÓDIGO PARA CADA CONTROL.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar