Guest User

Untitled

a guest
Jan 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. private void txtStock_KeyPress(object sender, KeyPressEventArgs e)
  2. {
  3. //if (e.KeyChar == 8)
  4. //{
  5. // e.Handled = false;
  6. // return;
  7. //}
  8.  
  9.  
  10. //bool IsDec = false;
  11. //int nroDec = 0;
  12.  
  13. //for (int i = 0; i < txtStock.Text.Length; i++)
  14. //{
  15. // if (txtStock.Text[i] == ',')
  16. // IsDec = true;
  17.  
  18. // if (IsDec && nroDec++ >= 2)
  19. // {
  20. // e.Handled = true;
  21. // return;
  22. // }
  23.  
  24.  
  25. //}
  26.  
  27. //if (e.KeyChar >= 48 && e.KeyChar <= 57)
  28. // e.Handled = false;
  29. //else if (e.KeyChar == 44)
  30. // e.Handled = (IsDec) ? true : false;
  31. //else
  32. // e.Handled = true;
  33.  
  34. }
Add Comment
Please, Sign In to add comment