-
¿Has probado a poner And en la comparación? si es if, claro...
-
pues tambien prodria ser con Or .... si tal cosa or esta blablavbla
un saludo.
-
aaapz jejeje leí mal xD ...... pero con and deberia salir perfecto :S jejeje bueno será revisar que esté bien el code no?
un saludo.
if numpad8=apretado and numpad 6 = apretado then
blablabla..
end if
if numpad6 = apretado (no se como lo hiciste) then
hace tal cosa
end if
if numpad8 = apretado.........
end if
respeta el orden :D
-
crea un variable tipo switch que sea true en el keydown de la tecla y false en el keyup, luego comparas:
dim keynumpad6 as integer
dim keynumpad8 as integer
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 97 Then
keynumpad6 = false
end if
If KeyCode = 98 Then
keynumpad8 = false
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 97 Then
keynumpad6 = true
end if
If KeyCode = 98 Then
keynumpad8 = true
End If
if keynumpad6 and keynumpad8 then
msgbox("estan las dos teclas presionadas")
end if
End Sub
no se los codigos de las teclas, solo lo hice a modo de ejemplo, ahi tu lo corriges.
otra forma es usar las apis, que tiene funciones para preguntar si X tecla se encuentra presionada o no.
espero que te sirva.
saludos.
pd: las variables son boolean no integer, sorry ;)
-
-
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If Shift = vbShiftMask Then
'Si está presionada la tecla shift.
'
Select Case KeyCode
Case vbKeyNumpad6:
Case vbKeyNumpad8:
End Select
Else
'Lo que haría con la misma tecla si Shift no está presionado.
'
Select Case KeyCode
Case vbKeyNumpad6:
Case vbKeyNumpad8:
End Select
End If
Saludos.