Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
C# / VB.NET - SOLO numeri
Forum - C# / VB.NET - SOLO numeri

Avatar
Teolo (Normal User)
Newbie


Messaggi: 17
Iscritto: 22/11/2009

Segnala al moderatore
Postato alle 14:02
Domenica, 14/02/2010
Questo topic è stato chiuso dal moderatore

Salve a tutti, avrei bisogno di un piccolo aiuto, chi di voi sa come dire ad una textbox che i caratteri accettati come input sono solo numeri?

PM
Avatar
Alfonso (Ex-Member)
Guru


Messaggi: 688
Iscritto: 30/09/2009

Segnala al moderatore
Postato alle 14:26
Domenica, 14/02/2010

Codice sorgente - presumibilmente VB.NET

  1. Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
  2.         If InStr("0123456789", e.KeyChar) = 0 Then
  3.             e.KeyChar = ""
  4.         End If
  5. End Sub


PM