Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void txtStock_KeyPress(object sender, KeyPressEventArgs e)
- {
- //if (e.KeyChar == 8)
- //{
- // e.Handled = false;
- // return;
- //}
- //bool IsDec = false;
- //int nroDec = 0;
- //for (int i = 0; i < txtStock.Text.Length; i++)
- //{
- // if (txtStock.Text[i] == ',')
- // IsDec = true;
- // if (IsDec && nroDec++ >= 2)
- // {
- // e.Handled = true;
- // return;
- // }
- //}
- //if (e.KeyChar >= 48 && e.KeyChar <= 57)
- // e.Handled = false;
- //else if (e.KeyChar == 44)
- // e.Handled = (IsDec) ? true : false;
- //else
- // e.Handled = true;
- }
Add Comment
Please, Sign In to add comment