Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB: Allowing Only Numbers (not Letters) To Be Entered Into Textbox

I have a textbox which controls the interval of a Timer control. How do I filter out letters? Is it possible to restrict entry to numbers only (like if you enter a letter or a space, nothing happens)? Is there a property of the textbox that can accomplish this? Thanks!

like image 933
David Avatar asked Dec 29 '22 11:12

David


1 Answers

Is replacing the textbox with another control an option? In my experience I found the NumericUpDown control easier to work with if you want to restrict input to numeric values only.

It also has cute up and down arrows, but best of all, it requires no extra code.

like image 198
MiseryIndex Avatar answered Jan 01 '23 01:01

MiseryIndex