在窗体上从仨到右有Text1、Text2两个文本框,如图所示,要求程序运行时,在Text1 中输入1个分数后按
A.Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii==13 Then 回车符的ASCIl码是13 a=Val(Text1) If a>=0 Or a<=100 Then Text2.SetFocus Else Text1.SetFocus:MsgBox("分数错") End If End If End Sub
B.Private Sub Textl—KeyPress(KeyAscii As Integer) If KeyAseii=13 Then 回车符的ASCIl码是13 a=Val(Text1) If a>=0 And a<=100 Then Textl.SetFocus Else Text2.SetFocus:MsgBox("分数错") End If End If End Sub
C.Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii=13 Then 回车符的ASCII码是13 a=Val(Text1) If a<0 And a>100 Then Text2.SetFocus Else Text1.SetFocus:MsgBox("分数错") End If End If End Sub
D.Private Sub Text1_KeyPress(KeyAscii As Integer) If KevAscii=13 Then 回车符的ASCII码是13 a=Val(Textl) If a>=0 Aad a<=100 Then Text2.SetFocus Else Text1.SetFocus:MsgBox("分数错") End If End If End Sub