Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/12/2006, 18:10
Avatar de chaval
chaval
 
Fecha de Ingreso: febrero-2003
Ubicación: en elgun lugar del cyberespacio
Mensajes: 118
Antigüedad: 22 años, 3 meses
Puntos: 0
ya le encontre la vuelta, cree una funcion que deje solo ingresar numeros, "-" y borrar:

Código:
Function soloNumeros(ByVal teclaIngresada As Integer) As Integer
    If InStr("0123456789-", Chr(teclaIngresada)) = 0 Then
        soloNumeros = 0
    Else
        soloNumeros = teclaIngresada
    End If
    If teclaIngresada = 8 Then soloNumeros = teclaIngresada      
End Function
y despues:

Código:
Private Sub txtTelefono_KeyPress(teclaIngresada As Integer)
    teclaIngresada = soloNumeros(teclaIngresada)
End Sub
tambien podria haber utilizado solo lo que sigue, pero el problema era el "-":

Código:
Private Sub txtTelefono_KeyPress(KeyAscii As Integer)
    If ((KeyAscii < 48 Or KeyAscii > 57) And (KeyAscii < 44 Or KeyAscii > 44)) Then
        If (KeyAscii <> 8) Then KeyAscii = 0
    End If
End Sub
si alguien sabe como poder ingresar el "-", en esta ultima como para saber otra opcion, gracias.
__________________
CHAVAL
Buenos Aires, Argentina, América, La Tierra,
Via Lactea, Universo Tridemensional... :pensando:

Última edición por chaval; 03/12/2006 a las 18:33