private void txtZGZFJZMJ_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar < '0' && e.KeyChar != '.' || e.KeyChar > '9' && e.KeyChar != '.' || ((TextBox)(sender)).Text.IndexOf('.') >= 0 && e.KeyChar == '.') && e.KeyChar != (char)13 && e.KeyChar != (char)8)
{
e.Handled = true;
}
}
//写在textbox的KeyPress事件下面!