- Private Sub test_KeyPress(KeyAscii As Integer)
-
- Dim i As Integer ' la varialbe :)
- Dim chiffres ' le tableau
-
- nums = Array(65,12,58,69,45,65,26,32) ' le tableau contenant le code ASCII des caractères permis .
-
- For i = LBound(nums) To UBound(nums) ' on fé une boucle
-
- If KeyAscii = nums(i) Then ' on teste le caractère
-
- GoTo fin 'ca corresponds ! c permis alors on l'affiche
-
- End If
-
- Next i ' ca correspond pas on compare alors avec le caractère permis suivant
-
- 'Eh ben ca correspond pas du tout donc on n'affiche pas !
- KeyAscii = 0 ' on affecte la valeur 0 au keyascii
- Beep' on emet un beep
-
- fin: ' la finnnnn
- End Sub
Private Sub test_KeyPress(KeyAscii As Integer)
Dim i As Integer ' la varialbe :)
Dim chiffres ' le tableau
nums = Array(65,12,58,69,45,65,26,32) ' le tableau contenant le code ASCII des caractères permis .
For i = LBound(nums) To UBound(nums) ' on fé une boucle
If KeyAscii = nums(i) Then ' on teste le caractère
GoTo fin 'ca corresponds ! c permis alors on l'affiche
End If
Next i ' ca correspond pas on compare alors avec le caractère permis suivant
'Eh ben ca correspond pas du tout donc on n'affiche pas !
KeyAscii = 0 ' on affecte la valeur 0 au keyascii
Beep' on emet un beep
fin: ' la finnnnn
End Sub