if ((e.KeyChar < '0' || e.KeyChar > '9') && e.KeyChar != 8 )
{
e.Handled = true;
}
if (("0123456789.".IndexOf(e.KeyChar)==-1) && e.KeyChar != 8)
{
e.Handled = true;
}
if (txtSL.Text.IndexOf(".") >= 0 && (".".IndexOf(e.KeyChar) >= 0)) { e.Handled = true; }