SomeTips for much easier and much simpler...
//限制Textbox只能輸入數字 private void integerTextBox_KeyPress( object sender, KeyPressEventArgs e) { Char keyChar = e.KeyChar; if ((keyChar < 48 || keyChar > 57) && keyChar != 8) e.Handled = true; }
沒有留言:
張貼留言