Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Masked TextBox .Net 2.0

Masked TextBox .Net 2.0

Scheduled Pinned Locked Moved C#
csharpquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KrunalC
    wrote on last edited by
    #1

    When you place the Masked Textbox on form and set the Mask property, text box shows the preview of masked format. e.g. if user has selected integer with 5 digit as mask then Mask Textbox will display the text as"_____" in the text box. At the runtime also user will see "_____" as text in the textbox, until any value is entered. If user enters one digit(say "1") then text in the text box will look like "1____". So dynamically user is guided about the possible formatting and value which user can key in. If I don't want to use the masked text box and i make a control derived from text box how this dynamic preview like masked text box can be implemented? I request people to look at the functioning of the Masked textbox once for better idea of what I'm looking for. Pls come up with your ideas.

    D 1 Reply Last reply
    0
    • K KrunalC

      When you place the Masked Textbox on form and set the Mask property, text box shows the preview of masked format. e.g. if user has selected integer with 5 digit as mask then Mask Textbox will display the text as"_____" in the text box. At the runtime also user will see "_____" as text in the textbox, until any value is entered. If user enters one digit(say "1") then text in the text box will look like "1____". So dynamically user is guided about the possible formatting and value which user can key in. If I don't want to use the masked text box and i make a control derived from text box how this dynamic preview like masked text box can be implemented? I request people to look at the functioning of the Masked textbox once for better idea of what I'm looking for. Pls come up with your ideas.

      D Offline
      D Offline
      Dave Sexton
      wrote on last edited by
      #2

      Create a new control that inherits from MaskedTextBox.


      I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.

      • • •

      But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson

      K 1 Reply Last reply
      0
      • D Dave Sexton

        Create a new control that inherits from MaskedTextBox.


        I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.

        • • •

        But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson

        K Offline
        K Offline
        KrunalC
        wrote on last edited by
        #3

        Dave, Thanks for your reply. But solution suggested by you is not the one I'm looking at. I need to develope the things considering that I'm developing on framework 1.1 and Masked Textbox object doesn't exist at all. At the most I can derive my custome control from TextBox only. I just need some ideas from members. Thanks.

        D 1 Reply Last reply
        0
        • K KrunalC

          Dave, Thanks for your reply. But solution suggested by you is not the one I'm looking at. I need to develope the things considering that I'm developing on framework 1.1 and Masked Textbox object doesn't exist at all. At the most I can derive my custome control from TextBox only. I just need some ideas from members. Thanks.

          D Offline
          D Offline
          Dave Sexton
          wrote on last edited by
          #4

          KrunalC wrote:

          At the most I can derive my custome control from TextBox only.

          I think you've just answered your own question. Have a look at this[^] and this[^]. I think you should get a few ideas from the results on the first link.


          I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.

          • • •

          But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson

          K 1 Reply Last reply
          0
          • D Dave Sexton

            KrunalC wrote:

            At the most I can derive my custome control from TextBox only.

            I think you've just answered your own question. Have a look at this[^] and this[^]. I think you should get a few ideas from the results on the first link.


            I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.

            • • •

            But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson

            K Offline
            K Offline
            KrunalC
            wrote on last edited by
            #5

            I went through the links suggested by you but not to much help. If I simply derive from Text bok then lot of effort will be required to bring it to the level of masked textbox. Need to override onpaint, handle keypress n other events n will require lot of testing efforts. Confused regarding what to do?:zzz:

            D 1 Reply Last reply
            0
            • K KrunalC

              I went through the links suggested by you but not to much help. If I simply derive from Text bok then lot of effort will be required to bring it to the level of masked textbox. Need to override onpaint, handle keypress n other events n will require lot of testing efforts. Confused regarding what to do?:zzz:

              D Offline
              D Offline
              Dave Sexton
              wrote on last edited by
              #6

              It's not that much effort. Still, no pain = no gain. Think of it as a learning curve, it'll do you good. The other option is to use one of the VS Express editions or buy VS 2005.


              I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.

              • • •

              But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups