Implementing a masked edit text box in C#

Posted on 2006-06-05
Last Modified: 2012-06-27

Is there a way to implement a masked edit text box in C#?

Specifically, I want to place a text box on a form that only accepts input in a time format (ie:  10:11:02); so that the first character has to be a digit between 0 and 9, the second has to be a character between 0 and 9, the third has to be a : character, etc.

Thanks in advance,
Question by:tmitchell68
    LVL 35

    Accepted Solution

    You can use javascript or some other scripting to auto format as keys are pressed and remove non-allowed characters.

    For example Turbo Tax and H&R Block tax programs use this - especially on the web versions
    LVL 6

    Expert Comment

    There are a ton of links if you search on google.

    This one seems to fit your bill:

    Let me know if this is what you need else I'll hunt some more,

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now