L Lou Aug 16, 2005 #1 How can I limit the input to just digits 0-9 in VB6 I would use the if KeyAscii<48 or Keyascii >57 then Keyascii=0 -Lou
How can I limit the input to just digits 0-9 in VB6 I would use the if KeyAscii<48 or Keyascii >57 then Keyascii=0 -Lou
C Chris Aug 16, 2005 #2 Lou said: How can I limit the input to just digits 0-9 in VB6 I would use the if KeyAscii<48 or Keyascii >57 then Keyascii=0 -Lou Click to expand... I assume you mean in the keypress event... if asc(e.keychar) < keys.0 or asc(e.keychar) > Keys.9 then e.handled = true end if I'm not positive but I think you also need... if asc(e.keychar) < keys.D0 or asc(e.keychar) > keys.D9 then e.handled = true end if Chris
Lou said: How can I limit the input to just digits 0-9 in VB6 I would use the if KeyAscii<48 or Keyascii >57 then Keyascii=0 -Lou Click to expand... I assume you mean in the keypress event... if asc(e.keychar) < keys.0 or asc(e.keychar) > Keys.9 then e.handled = true end if I'm not positive but I think you also need... if asc(e.keychar) < keys.D0 or asc(e.keychar) > keys.D9 then e.handled = true end if Chris