Guest User

Untitled

a guest
Nov 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. TextBox tb = new TextBox();
  2. this.Controls.Add(tb);
  3.  
  4. private void tb_KeyPress(object sender, KeyPressEventArgs e)
  5. {
  6. if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) )
  7. {
  8. e.Handled = true;
  9. }
  10. }
Add Comment
Please, Sign In to add comment