Sign in to follow this  

[.net] MaskedTextBox: allowing negative numbers

This topic is 4093 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a MaskedTextBox control. I only want to allow the user to input numbers, but I want to allow negative numbers. Specifying a mask of, say, 000 doesn't allow that. Specifying a mask of -000 requires the numbers to be negative. Any ideas? Thanks very much.

Share this post


Link to post
Share on other sites
You can do #000 to allow the first character to be a sign character. Unfortunately, it can also be a number, so if they enter a sign, they can only enter a 3 digit number, but otherwise they can enter a 4 digit number. That's the only way I know...

Share this post


Link to post
Share on other sites

This topic is 4093 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this