• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

Multi-Selction in List Boxes

Ok, I am making a program for playing music.  When the user selects the song it goes into the list box as a string and so on as they choose more songs.  I want them to be able to select several songs and they can choose the next one or the previous.  It only plays the last song the user clicks on.  My code is-
Command2_click
Dim song as string
song= List1.text
MMcontrol1.filename= song
MMcontrol1.command="open"
MMcontrol1.command="Load"
End Sub

Im a bit of a noob so it might be simple:P. Thanks
0
Phantom61
Asked:
Phantom61
  • 4
2 Solutions
 
learning_t0_pr0gramCommented:
set the MultiSelection property to "Extended".. then hold control to select more than one song
0
 
unknown_routineCommented:
Hi,

Use this:

Dim i
Dim song as string

For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then
  song=List1.List(i)
  MMcontrol1.filename= song
  MMcontrol1.command="open"
  MMcontrol1.command="Load"
end if
Next i


End If

Next i
0
 
unknown_routineCommented:

remove extra

End If

Next i

in the code above


so code is :

Dim i
Dim song as string

For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then
  song=List1.List(i)
  MMcontrol1.filename= song
  MMcontrol1.command="open"
  MMcontrol1.command="Load"
End if
Next i


0
 
unknown_routineCommented:
By the way ,

to make user able to select multi items, change the multiselect property of
the listbox to Simple.
0
 
unknown_routineCommented:
I supplied complete answer for this question.

An split seems proper with 80% for  unknown_routine and 20% for learning_t0_pr0gram.
 


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now