1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| dans un module: public iKeyBuffer as integer
Private Sub Form_KeyPress(KeyAscii As Integer)
If iKeyBuffer <> 0 Then KeyAscii = 0
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyAdd Or KeyCode = vbKeySubtract Then
iKeyBuffer = 0
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyAdd Or KeyCode = vbKeySubtract Then
iKeyBuffer = KeyCode
End If
Select Case KeyCode
Case vbKeyNumpad1
Select Case iKeyBuffer
Case vbKeyAdd
Imgx(0).Zoom = Imgx(0).Zoom + 0.01
Case vbKeySubtract
Imgx(0).Zoom = Imgx(0).Zoom - 0.01
End Select
Case vbKeyNumpad2
Select Case iKeyBuffer
Case vbKeyAdd
Imgx(2).Zoom = Imgx(2).Zoom + 0.01
Case vbKeySubtract
Imgx(2).Zoom = Imgx(2).Zoom - 0.01
End Select
End Select
End Sub |