菜鸟学VB,请教一个变量赋值的问题
想获取Text1.text中的数值,设置了一个整形的全局变量psd,但是执行下来该变量值始终是‘0’“
Public psd As Integer
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
psd = Val(Text1.Text)
End If
End Sub
”
请问哪里出错了嘛?
谢谢
Public psd As Integer Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then '打完字要按Enter psd = Val(Text1.Text) End If 'MsgBox psd End Sub