求救!一段VB代码,不知道哪里错了

来源:百度知道 编辑:UC知道 时间:2024/05/29 00:00:49
Private Sub Command1_Click(Index As Integer)
Dim prompt, tittle, default As String
Dim xpos, ypos As Single
Select Case Index
Case 0
prompt = Text1(0).Text
tittle = Text1(1).Text
default = Text1(2).Text
If poschk Then
xpos = Text1(3).Text
ypos = Text1(4).Text
a$ = InputBox(prompt, tittle, default, xpos, ypos)
Else
a$ = InputBox(prompt, tittle, default, xpos, ypos)
Label1(5).Caption = "谢谢您的投票,您的选择是" & a$ & "!"
Case 1
Unload Me
End Select
End Sub

运行提示,case 1没有 select case

case 1 前面少一行 end if

IF..ELSE ...END IF
没有关闭IF。在CASE 1前加上 END IF

If poschk Then
xpos = Text1(3).Text
ypos = Text1(4).Text
a$ = InputBox(prompt, tittle, default, xpos, ypos)
Else
a$ = InputBox(prompt, tittle, default, xpos, ypos)
Label1(5).Caption = "谢谢您的投票,您的选择是" & a$ & "!"

这个if的endif没有写!~

没有End if