Number Textbox

  • Thread starter Thread starter Jared
  • Start date Start date
J

Jared

Hi,

I have decided the best way to prevent characters from data entry is to use
numericupdown control.

The only problem is I need way to hide the updown control....wish there was
a property for this.

Anyone now easy way to get rid of updown arrows.

Thanks
Jared
 
Jared

Simply process the KeyPress event and ignore entries that does not comply
with Char.IsDigit or Char.IsControl.
 
If you only test for Char.IsDigit only numbers will be accepted, but then
backspace would not work, even though delete does. This is solved by also
testing for Char.IsControl.
 
If you set the ES_NUMBER style (as shown in the code I posted) you don't
need to worry about IsDigit, IsControl or KeyPress

/claes

If you only test for Char.IsDigit only numbers will be accepted, but then
backspace would not work, even though delete does. This is solved by also
testing for Char.IsControl.
 
Back
Top