如何限制用户在C#(WPF)的文本框中输入多个小数点
问题描述:
我有一个文本框(计划小时),我输入的值如12.4或1.5等...所以现在当用户输入2 ...时,它不应该允许输入多个小数点。目前文本框只允许小数点后的数字,如1.5。
i设置文本框的最大长度= 4,以wpf为单位。
那么请有人能为我提供解决方案吗?
i have a text box(planned hours) where am entering values like 12.4 or 1.5 etc... so now when the user just enters 2..., it should not allow to enter more than one decimal point.And currently the textbox will allow only digit after the decimal point like 1.5.
i have set the max length of the text box =4 in wpf.
So please can anyone provide me a solution?