请帮我看一下下面得代码哪里错了,错了可以帮我该一下吗?
Public Sub Command1_Click()
start:
Text1.Text = ""
Text1.SetFocus
End SubPublic Sub Command2_Click()
If Text1.Text <> abc Then
MsgBox ("口令不正确")
GoTo start
Else
Picture1.Picture = LoadPicture("C:\Documents and Settings\lkng\桌面\apple.ico")
End If
End Sub
我都是用public定义得啊,为什么goto start就不可以呢?如果不用上面得要在command2中调用command1得语句怎样调用啊?
Public Sub Command1_Click()
start:
Text1.Text = ""
Text1.SetFocus
End SubPublic Sub Command2_Click()
If Text1.Text <> abc Then
MsgBox ("口令不正确")
GoTo start
Else
Picture1.Picture = LoadPicture("C:\Documents and Settings\lkng\桌面\apple.ico")
End If
End Sub
我都是用public定义得啊,为什么goto start就不可以呢?如果不用上面得要在command2中调用command1得语句怎样调用啊?
MsgBox ("口令不正确")
command1_click
Else……
If Text1.Text <> abc Then
MsgBox ("口令不正确")
Command1_Click
Else
Picture1.Picture = LoadPicture("C:\Documents and Settings\lkng\桌面\apple.ico")
End If
End Sub
你甚至可以重新建立一个函数做为你要反复调用的模块!