Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 38023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:38:34+00:00 2026-05-10T14:38:34+00:00

Does anyone know why Microsoft does not ship a numeric text box with its

  • 0

Does anyone know why Microsoft does not ship a numeric text box with its .NET framework e.g. a text box which would ensure that the characters entered are always a valid number? It’s something which is commonly used across applications of different flavours and indeed something which most GUI libraries (well, those that I know) deliver in some way. While it’s not that difficult to write your own, it’s not trivial either.

So, I’m interested in finding out if anyone can rationalise this omission.

edit: Thanks for the suggestions. Whilst masked text boxes and numeric up-downs have their place; I am interested in a control that looks like a text box but automatically performs validation on key press that the input corresponds to a valid number. In my (admittedly limited) experience, this is something which is used quite a bit (we don’t always want the static constraints imposed by masked text boxes, just as we don’t always want the up-down controls at the side).

There are lots of implementations with varying degrees of quality of this on the net and indeed there’s even an example of this on the MSDN.

edit2: Thanks guys, so it sounds like the numeric up-down is the .NET control to use for numeric input only (and the reason why we don’t actually have an explicit numeric text box control). It would have been great if it automatically disallowed the input of non-numeric characters (on keypress, on paste etc) but I guess it’s good enough that it performs the validation when the control loses focus. And, one could do the on keypress, on paste validation if one were really keen…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T14:38:34+00:00Added an answer on May 10, 2026 at 2:38 pm

    I second Garry Shutlers recommendation of using NumericUpDown. You might not like the up-down-controls, but that is the standard look of a numeric entry control in Windows, and you should think twice about using a different look.

    If you end up coding your own implementation (or finding one on the web), there are some pitfalls to look out for. Remember that there are many ways for a value to get into a control besides keypresses. The one in your link on MSDN does not even override pasting, so you can easily ctrl-V a non-numeric string into the control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 118k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Assuming your controller class derives from System.Web.Mvc.Controller (probably this is… May 11, 2026 at 11:32 pm
  • Editorial Team
    Editorial Team added an answer It's because the this scope refers to a cfc instance.… May 11, 2026 at 11:32 pm
  • Editorial Team
    Editorial Team added an answer I think the maximium size of a cookie is about… May 11, 2026 at 11:32 pm

Related Questions

This code shows that the Delegate Command from the Visual Studio MVVM template works
I am writing a multi-threaded Windows application in Microsoft Visual C# 2008 Express Edition.
I have created a .net web part and deployed it on the sharepoint site.
I've got a small little page that is going to be viewed from a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.