Creating a numeric-only textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi! I'm trying to subclass a TextBox and make it so only numeric characters
may be entered. I thought the easiest way would be to override the
"OnKeyPress" method, check the data, and set the character to 0 if invalid
(this worked in eVb!!!). But, it looks like this is a no-go because the
character is readonly. Any ideas on how I can restrict non-numeric
characters?
 
Wouldn't you know it, the solution was right in front of my face...so THATS
what the "Handled" property is for! Thanks for the help, I'm kinda new to
this .Net stuff!
 
Back
Top