private void txtTrueCome_KeyPress(object sender, KeyPressEventArgs e)
{
if (!(((e.KeyChar >= '0') && (e.KeyChar <= '9')) || e.KeyChar <= 31))
{
if (e.KeyChar == '.')
{
if (((TextBox)sender).Text.Trim().IndexOf('.') > -1)
e.Handled = true;
}
else
e.Handled = true;
}
else
{
if (e.KeyChar <= 31)
{
e.Handled = false;
}
}
if (e.KeyChar == 46)
{
if (((TextBox)sender).Text.Trim().Length <= 0)
e.Handled = true;
}
if (!(((e.KeyChar >= '0') && (e.KeyChar <= '9')) || e.KeyChar <= 31))
{
if (e.KeyChar == '.')
{
if (((TextBox)sender).Text.Trim().IndexOf('.') > -1)
e.Handled = true;
}
else
e.Handled = true;
}
else
{
if (e.KeyChar <= 31)
{
e.Handled = false;
}
}
}