Private Sub Command1_Click()
Text1.Text = ""
Dim A() As String, I As Integer, K As Integer
K = 0
For I = 0 To List1.ListCount - 1
If List1.Selected(I) Then
K = K + 1
ReDim Preserve A(1 To K)
A(K) = List1.List(I)
End If
Next
Text1.Text = Join(A, ",")
Erase A
End Sub
Private Sub Form_Load()
Dim I As Integer
For I = 0 To 25
List1.AddItem String(5, Chr(I + 97))
Next
End Sub
Private Sub Command1_Click()
Text1.Text = ""
For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then
If Text1.Text = "" Then
Text1.Text = List1.List(i)
Else
Text1.Text = List1.List(i) + "," + Text1.Text
End If
End If
Next i
End Sub
Private Sub Form_Load()
List1.AddItem "aaaa"
List1.AddItem "bbbb"
List1.AddItem "cccc"
List1.AddItem "dddd"
End Sub