potresti fare così:
e ad ogni kei press fai:codice:Private Function TestChar(myAsciiCode as integer) As integer 'Fai i controlli che devi If Controlli = ok Then 'Carattere valido Return myAsciiCode Else 'Carattere non valido Return 0 End If End Fucntion
dove KeyAscii è il valore del carattere premuto alla KeyPresscodice:KeyAscii = TestChar(KeyAscii)