请教VB的高手!追分!

来源:百度知道 编辑:UC知道 时间:2024/05/18 00:07:34
帮我看看下面这段代码哪出错了?
为何程序运行起来以后,不输入数字,点提交按钮,在程序的左方会出现一个数字"1" 再点一次 会陆续出现第二个数字"1"
很是郁闷啊!!!!

Private Sub command1_click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
cuowu = MsgBox("请正确输入!", 0, "提示信息")
Print cuowu
Exit Sub
Else
End If

'Dim data
'data = Text1.Text
Open "c:\1.txt" For Output As #1
Print #1, Text1, Text2, Text3
Close #1
answer = MsgBox("提交成功!", 0, "提示信息")
Print answer
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then
KeyAscii = 8
Exit Sub
End If
If KeyAscii < 47 Or KeyAscii > 58 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then
KeyAscii = 8
Exit Sub
End If
If KeyAscii < 47 Or

Private Sub command1_click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
cuowu = MsgBox("请正确输入!", 0, "提示信息")
Exit Sub
Else
Print cuowu
End If

这个就没问题了

Private Sub command1_click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
cuowu = MsgBox("请正确输入!", 0, "提示信息")
Exit Sub
Else
End If

Open "c:\1.txt" For Output As #1
Print #1, Text1, Text2, Text3
Close #1
answer = MsgBox("提交成功!", 0, "提示信息")
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then
KeyAscii = 8
Exit Sub
End If
If KeyAscii < 47 Or KeyAscii > 58 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then
K