Private Sub TextBox2_KeyPress(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.KeyPress If Asc(e.keychar) = 13 Then If Not IsNumeric(TextBox2.Text) Then TextBox2.Text = "" TextBox2.Focus() End If End If End Sub
1 回答

蝴蝶不菲
TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊
把ByVal e as System.EventArgs改為ByVal e As System.Windows.Forms.KeyPressEventArgs即可
Private Sub TextBox2_KeyPress( ByVal sender As System. Object , ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress If Asc(e.KeyChar) = 13 Then If Not IsNumeric(TextBox2.Text) Then TextBox2.Text = "" TextBox2.Focus() End If End If End Sub |
- 1 回答
- 0 關(guān)注
- 318 瀏覽
添加回答
舉報(bào)
0/150
提交
取消