codice:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Not IsNumeric(Chr(KeyAscii)) Then
KeyAscii = 0
End If
End Sub
così impedisci all'utente di scrivere caratteri non numerici...
se hai molte textbox fatti una funzione così:
codice:
Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = ControllaDigitazione(KeyAscii)
End Sub
Public Function ControllaDigitazione(KeyAscii As Integer) As Integer
If Not IsNumeric(Chr(KeyAscii)) Then
KeyAscii = 0
End If
ControllaDigitazione = KeyAscii
End Function
ciau!
se ho cannato qualcosa o hai bisogno di altro chiedi pure...