gustyfle
Usuario (Argentina)
hola es mi primer post..... soy programador y estuve viendo en varrios foros de preguntas que no encontraban un codigo en VB 6 que Limite el contenido de un TEXT a solo letras y en Mayusculas y con cantidad de caracteres restrinigidos.... espero que les sea util Private Sub Text1_KeyPress(KeyAscii As Integer) Dim CadenaTemporal As String ' VARIABLE If KeyAscii = 13 Then KeyAscii = 0 'SendKeys "{tab}' ES OPCIONAL ElseIf KeyAscii <> 8 Then If (KeyAscii < 65 Or KeyAscii > 90) And (KeyAscii < 97 Or KeyAscii > 122) Then Beep KeyAscii = 0 End If End If CadenaTemporal = Chr(KeyAscii) 'VARIABLE QUE TOMA EL CONTENIDO DEL KEY ASCII OSEA EL TEXT KeyAscii = Asc(UCase(CadenaTemporal)) 'ACA SE TRANSFORMA EN MAYUSCULAS Text1.MaxLength = 3 'EJEMPLO DE CANT DE CARACTERES End Sub