I\'m looking to accept digits and the decimal point, but no sign.
I\'ve looked at samples using the NumericUpDown control for Windows Forms, and this sample of a Num
If you do not want to write a lot of code to do a basic function (I don't know why people make long methods) you can just do this:
Add namespace:
using System.Text.RegularExpressions;
In XAML, set a TextChanged property:
In WPF under txt1_TextChanged method, add Regex.Replace:
private void txt1_TextChanged(object sender, TextChangedEventArgs e)
{
txt1.Text = Regex.Replace(txt1.Text, "[^0-9]+", "");
}