
INPUTBOX.
Publicado por Adolfo (117 intervenciones) el 22/10/2002 18:44:23
Tengo el siguiente código para hacer que en una caja de texto sólo se puedan digitar números.
Private Sub TxtNumReg_KeyPress(KeyAscii As Integer)
If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
If KeyAscii <> 8 Then ' este es el Backspace
KeyAscii = 0
Beep
End If
End If
End Sub
Pero necesito hacer esto mismo desde un INPUTBOX, ¿Cómo lo hago?
Gracias.
Private Sub TxtNumReg_KeyPress(KeyAscii As Integer)
If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
If KeyAscii <> 8 Then ' este es el Backspace
KeyAscii = 0
Beep
End If
End If
End Sub
Pero necesito hacer esto mismo desde un INPUTBOX, ¿Cómo lo hago?
Gracias.
Valora esta pregunta


0