Good evening,
trying to make WPF textbox accept only double value between 3 and 2813
in the code below ,I can't write any value start with 1 or 2
like 11,22,113,215,2008
private bool IsValid(string str)
{
double i;
return double.TryParse(str, out i) && i >= 3 && i <= 2813;
}
private void L_Text_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
e.Handled = !IsValid(((TextBox)sender).Text + e.Text);
}