Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/05/2010, 03:27
Avatar de tuka_85
tuka_85
 
Fecha de Ingreso: febrero-2010
Ubicación: Santander/Huelva
Mensajes: 190
Antigüedad: 14 años, 2 meses
Puntos: 5
Primera posicion en un textbox

Hola.

Quisiera saber como hacer lo siguiente...

Tengo que hacer, que en un textbox, solo me deje introducir numeros, pero que me deje poner el signo "-" SOLO en la posicion uno.

He hecho algo asi..

Código:
    Private Sub txtNumeros_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtNumeros.TextChanged
        If Not IsNumeric(Trim(txtNumeros.Text)) And Len(Trim(txtNumeros.Text)) > 0 Then
            MsgBox("Solo puede intruducir numeros")
            txtNumeros.Text = ""
        End If
    End Sub