Ver Mensaje Individual
  #3  
Antiguo 23-09-2007
Avatar de tazzmk
tazzmk tazzmk is offline
Miembro
 
Registrado: sep 2007
Posts: 45
Reputación: 0
tazzmk Va por buen camino
Hola a todos
yo tengo algo alomejor te sirve

1.- como se puede limitar el ingreso a un Edit con un solo caracter o numero

crear un formulario, añadir un Edit y escribir el siguiente código:
Código:
Sub edit1_Keypress(KeyAscii As Integer)
    If KeyAscii <> Asc("9") Then
    'KeyAscii = 8 es el retroceso o BackSpace
       If KeyAscii <> 8 Then
           KeyAscii = 0
       End If
    End If
End Sub


Nuevo:
Código:
Private Sub edit1_Keypress(KeyAscii As Integer)
If Not IsNumeric(Chr$(KeyAscii)) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
2.- como puedo hacer un salto, Luego que se ingresa ese unico caracter al Edit1 salta hacia el Edit2

Pasar de un edit a otro al pulsar Enter:

Insertar dos edit y escribir el siguiente código:

Código:
Private Sub edi1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
KeyAscii = 0
End If
End Sub

Private Sub edi2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
KeyAscii = 0
End If
End Sub
eso seria

Última edición por tazzmk fecha: 23-09-2007 a las 19:50:13.
Responder Con Cita