用VB编写一个程序,输入用户名和密码后按回车没有反应,怎么弄呢?
代码如下:
Private Sub Text2_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
    If Text1 = "XXX" And Text2 = 1234 Then
      Form1.Show
      Form2.Hide
    Else
      Text2 = ""
      Text2.SetFocus
    End If
  End If
End Sub