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贡献1810条经验 获得超4个赞
把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 关注
- 279 浏览
添加回答
举报
0/150
提交
取消