grazie lo stesso, mo ho già risolto così:
ho fatto una funzione che verifichi il tasto
codice:
Public Function CheckKeyPressed(ByVal sKey As Char) As Char
Dim KeyAscii As Short = Asc(sKey)
If KeyAscii < 32 Then
Return sKey
Else
If InStr("0123456789,", sKey) > 0 Then
Return sKey
Else
Return ""
End If
End If
End Function
e poi l'ho usata così:
codice:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Dim KeyChar As Char = CheckKeyPressed(e.KeyChar)
If KeyChar = Nothing Then e.KeyChar = Nothing
End Sub