Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Multi-Selction in List Boxes

Posted on 2004-04-17
8
Medium Priority
?
205 Views
Last Modified: 2010-05-02
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
Comment
Question by:Phantom61
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
8 Comments
 
LVL 4

Accepted Solution

by:
learning_t0_pr0gram earned 100 total points
ID: 10850610
set the MultiSelection property to "Extended".. then hold control to select more than one song
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 10850817
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
 
LVL 15

Assisted Solution

by:unknown_routine
unknown_routine earned 100 total points
ID: 10850820

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
 
LVL 15

Expert Comment

by:unknown_routine
ID: 10850828
By the way ,

to make user able to select multi items, change the multiselect property of
the listbox to Simple.
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 11259215
I supplied complete answer for this question.

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


0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question