Mollethewizard
IS-IT--Management
I’ve learnt that one can prevent the user to insert nothing but numbers in a textbox by using the following code in the KeyPress event relating to a TextBox.
If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0
But I also would like the user to be able to use the – (asciicode 45) as well. He or she should be able to write for example, 145-03 in the box. How the heck do I write code to accomplish that?
Greetings from Sweden
Christer
If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0
But I also would like the user to be able to use the – (asciicode 45) as well. He or she should be able to write for example, 145-03 in the box. How the heck do I write code to accomplish that?
Greetings from Sweden
Christer