中美经济关系的未来:VB6.0中,text1的问题,请教!

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 03:49:57
准备在TEXT1中敲回车键激发一个事件,怎么写啊?
Private Sub Text2_KeyPress(KeyAscii As Integer)
If Key = Chr(13) Then
If Text1.Text = Text2.Text Then
Label1.Caption = "OK"
Else
MsgBox "NG"
End If
End If

End Sub
这样没有用,怎么写啊,多谢赐教!

If Keyascii = vbkeyreturn Then
If Text1.Text = Text2.Text Then
Label1.Caption = "OK"
Else
MsgBox "NG"
End If
End If