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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Hex/decimal/binary textbox. How?

Hex/decimal/binary textbox. How?

Scheduled Pinned Locked Moved .NET (Core and Framework)
tutorialquestion
2 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.
  • L Offline
    L Offline
    lclarsen
    wrote on last edited by
    #1

    Hi, I would like to implement a textbox into my application that allows the user to enter hex, decimal or binary values (based on the selection of a radiobutton group. For hex values, for example, I would like the entered data to be byte seperated by spaces like this: "0E 3C 32...". I was thinking that a masked textbox was the way to go, but a masked textbox only allows for a fixed length mask, it seems. AFAIK it is not possible to specify a mask that is repeated for the length of the entered data. Do I have to parse the content of the textbox and reset the contents whenever the user enters a single character, or is there a much simpler solution?

    B 1 Reply Last reply
    0
    • L lclarsen

      Hi, I would like to implement a textbox into my application that allows the user to enter hex, decimal or binary values (based on the selection of a radiobutton group. For hex values, for example, I would like the entered data to be byte seperated by spaces like this: "0E 3C 32...". I was thinking that a masked textbox was the way to go, but a masked textbox only allows for a fixed length mask, it seems. AFAIK it is not possible to specify a mask that is repeated for the length of the entered data. Do I have to parse the content of the textbox and reset the contents whenever the user enters a single character, or is there a much simpler solution?

      B Offline
      B Offline
      Bob X
      wrote on last edited by
      #2

      For a masked textbox you don't have to fill all of the mask spaces, so a mask: ###, can have a legal input of "1". You can also set the mask to lengthen itself when the user wants to enter a number longer than the set mask.

      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