Textbox-formatting value using databinding
C#
1
Posts
1
Posters
0
Views
1
Watching
-
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