Jump to content
  • Advertisement
Sign in to follow this  
silverphyre673

[.net] MaskedTextBox: allowing negative numbers

This topic is 4279 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!