小米手机3s屏要多少钱:VB6.0中,text1的问题,请教!

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/13 05:16:07
准备在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