Hi
in my code i have created a textbox that allows only numbers,but when i go to next control then it shows an error message "input is not valid".Eventhough i haven't created an error provider control to that text box.How can i fix it?
Can anyone help me please...?

Raja TPosted Sep 19, 2015, 4:57 AM
Try like
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && (e.KeyChar != '.'))
{
e.Handled = true;
}
// only allow one decimal point
if ((e.KeyChar == '.') && ((sender as TextBox).Text.IndexOf('.') > -1))
{
e.Handled = true;
}
}
Vivek JoyPosted Sep 19, 2015, 2:36 AM
Raja TPosted Sep 14, 2015, 6:07 AM
Vivek JoyPosted Sep 14, 2015, 4:26 AM
Raja TPosted Sep 14, 2015, 4:23 AM
Vivek JoyPosted Sep 14, 2015, 4:20 AM
Raja TPosted Sep 14, 2015, 12:38 AM
Vivek JoyPosted Sep 14, 2015, 12:28 AM
Rojalin SahooPosted Sep 12, 2015, 8:30 AM
Ravi KumarPosted Sep 12, 2015, 6:46 AM