大家帮看看这个VB程序哪里错了

来源:百度知道 编辑:UC知道 时间:2024/05/04 15:51:00
FORM1
Option Explicit

Public a As String
Public b As String
Public c As String
Public d As String
Public e As String
Public f As String
Public g As String
Public h As String
Private Sub command1_click()
Form2.Show
End Sub
Private Sub command2_click()
End
End Sub
Private Sub list1_click()
If List1.Selected(0) = True Then
a$ = List1.List(0)
ElseIf List1.Selected(1) = True Then
a$ = List1.List(1)
ElseIf List1.Selected(2) = True Then
a$ = List1.List(2)
End If
End Sub
Private Sub list2_click()
If List2.Selected(0) = True Then
b$ = List2.List(0)
ElseIf List2.Selected(1) = True Then
b$ = List2.Selected(1)
ElseIf List2.Selected(2) = True Then
b$ = List2.Selected(2)
End If

End Sub
Private Sub list3_click()
If List3.Selected(0) = True Then
c$ = List3.List(0)
ElseIf List3.Selected(1) = True Then
c$

Option Explicit

Public a As String
Public b As String
Public c As String
Public d As String
Public e As String
Public f As String
Public g As String
Public h As String
Private Sub command1_click()
Form2.Show
End Sub
Private Sub command2_click()
End
End Sub
Private Sub list1_click()
a = List1.List(List1.ListIndex)
End Sub
Private Sub list2_click()
b = List2.List(List2.ListIndex)
End Sub
Private Sub list3_click()
c = List3.List(List3.ListIndex)
End Sub

Private Sub Form_Load()
List1.AddItem "苹果"
List1.AddItem "栗子"
List2.AddItem "可乐"
List2.AddItem "汽水"
List3.AddItem "篮球"
List3.AddItem "足球"
End Sub