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. textbox

textbox

Scheduled Pinned Locked Moved C#
questioncsharpasp-nethelp
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.
  • S Offline
    S Offline
    sasan56
    wrote on last edited by
    #1

    Hi Dear I use VS2005 (ASP.NET 2) In TextBox or MaskedTextBox i want to show numbers with thousand separator like this : 12,254,236 but when i use the mask like 000,000,000 my number shown as 122,542,36 How can i solve the problem?

    L 1 Reply Last reply
    0
    • S sasan56

      Hi Dear I use VS2005 (ASP.NET 2) In TextBox or MaskedTextBox i want to show numbers with thousand separator like this : 12,254,236 but when i use the mask like 000,000,000 my number shown as 122,542,36 How can i solve the problem?

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, you can use the TextChanged event to first parse the string so you know the numeric value (use a format that allows for separators), then replace the text by the number in the format you want. But that is bound to be ugly, as soon as you edit a digit in the middle of the number, the cursor position and/or selection will act weird. Better approach is to keep the TextBox content as is, and have a Label next to the TextBox, and have that show the number in the format you want. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      Avoiding unwanted divs (as in "articles needing approval") with the help of this FireFox add-in


      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