User input in textboxes

  • Thread starter Thread starter noosaj
  • Start date Start date
N

noosaj

Hi,

I'm designing a basic sales tax calculator. I'm in a bind here. I am
trying to figure out how to prevent the user from inputting anything
other than numbers in the textboxes.

Obviously, only numbers can be used to calculate sales tax based on a
dollar amount the user inputs. Suppose the user inputs characters
other than numbers, such as punctuation or letters; how do I prevent
that? I would like to present a messagebox warning the user that he
or she has entered something other than numbers. How do I go about
doing this?

Thanks,

noosaj
 
noosaj said:
Hi,

I'm designing a basic sales tax calculator. I'm in a bind here. I am
trying to figure out how to prevent the user from inputting anything
other than numbers in the textboxes.

Obviously, only numbers can be used to calculate sales tax based on a
dollar amount the user inputs. Suppose the user inputs characters
other than numbers, such as punctuation or letters; how do I prevent
that? I would like to present a messagebox warning the user that he
or she has entered something other than numbers. How do I go about
doing this?
In the validating event

T
 
Noosaj,

Have a look at the masked textbox which is in VS starting at version 2005

Cor
 
Back
Top