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-formatting value using databinding

Textbox-formatting value using databinding

Scheduled Pinned Locked Moved C#
question
1 Posts 1 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.
  • J Offline
    J Offline
    jogisarge
    wrote on last edited by
    #1

    hello @all, i use this code to format number values in a textbox:

    tbxProzentwert1.DataBindings.Add("Text", bs, "prozentwert1", true, System.Windows.Forms.DataSourceUpdateMode.OnValidation, null, "#0.00#");

    I have no other Validation-Formatting in my prog. So the value will be formatted like 1 -> 1.00 0 -> 0.00 1.4 -> 1.40 thats ok. But if i write a character or leave the value blank, the focus will stick to the field. Now i have to put a 0 or any number i it to leave the textbox ... Is it possible to write a 0 to the value if the value can not be formated ? Bye jo

    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