473,395 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

advancing

lee123
556 512MB
if you have a list box with music in them how do you have it advance to the next one down to the next song when the one is over?

lee123
Aug 4 '08 #1
11 2469
debasisdas
8,127 Expert 4TB
try to increase the listindex by 1.
Aug 5 '08 #2
lee123
556 512MB
well i really don't know if this is right because i tried doing this and it didn't work

Expand|Select|Wrap|Line Numbers
  1. Private Sub List1_Click()
  2.     WindowsMediaPlayer1.URL = List1.Text
  3.     List1.ListIndex 1    
  4. End Sub
if this isn't right then how is it done, or do i stick this code in somewhere else? because when you try this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub List1_Click()
  2.     WindowsMediaPlayer1.URL = List1.Text
  3.     List1.ListIndex + 1    
  4. End Sub
it won't except the "+" sign

lee123
Aug 5 '08 #3
lee123
556 512MB
By the way i am using vb6 and a windows media player in my project

lee123
Aug 5 '08 #4
QVeen72
1,445 Expert 1GB
Hi,

I guess, you have to write the code in StatusChange() Event of the media player..
Check for WMP.Status
If WMP.Status = "Finished" Then


Regards
Veena
Aug 6 '08 #5
lee123
556 512MB
well i still can't get it to work now i have placed this in the "status change" and entered in this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub WindowsMediaPlayer1_StatusChange()
  2.     If WindowsMediaPlayer1.Status = "finished" Then
  3.         WindowsMediaPlayer1.URL = List1.Text
  4.         List1.ListIndex = List1.ListIndex + 1
  5.     End If
  6. End Sub
but nothing, mayby you can tell me whats wrong or what i can do.

lee123
Aug 6 '08 #6
debasisdas
8,127 Expert 4TB
try using this

List1.ListIndex = List1.ListIndex + 1
WindowsMediaPlayer1.URL = List1.list(list1.listindex)



do not forget to check listcount before incrementing the listindex
Aug 6 '08 #7
lee123
556 512MB
so do i put this in the WindowsmediaPlayer
like this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub WindowsMediaPlayer1_StatusChange()
  2.     If WindowsMediaPlayer1.Status = "finished" Then
  3.         List1.ListCount
  4.         List1.ListIndex = List1.ListIndex + 1
  5.         WindowsMediaPlayer1.URL = List1.List(List1.ListIndex)
  6.     End If
  7. End Sub
or in the listbox itself like this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub List1_Click()
  2.      WindowsMediaPlayer1.URL = List1.Text
  3.     List1.ListCount
  4. End Sub
or i don't think i understand what you mean or how the listcount works. i have searched in my books but the closes i have come to it is what i have listed here.

lee123
Aug 6 '08 #8
lee123
556 512MB
well i got it to go to the next one down but keep getting this error:

Expand|Select|Wrap|Line Numbers
  1. runtime error '380'
  2. invalid property value
but this is what i have done:

Expand|Select|Wrap|Line Numbers
  1. Private Sub WindowsMediaPlayer1_StatusChange()
  2.     If WindowsMediaPlayer1.Status = "Finished" Then
  3.         List1.ListIndex = List1.ListIndex + 1
  4.         WindowsMediaPlayer1.URL = List1.List(List1.ListIndex)
  5.         List1.ListIndex = List1.ListCount + 1
  6.  End If
can this be fixed to where i don't have an error? I have tried doing this error handler

Expand|Select|Wrap|Line Numbers
  1. On Error Resume Next
But that didn't work either what else can i do? or is this the way the code is suppose to be like?

lee123
Aug 6 '08 #9
QVeen72
1,445 Expert 1GB
Hi,

You need to Check if it is not the Last Index in the List..

Expand|Select|Wrap|Line Numbers
  1. If List1.ListIndex < (List1.ListCount-1) Then
  2.     List1.ListIndex = List1.ListIndex + 1
  3. End If
  4.  
Regards
Veena
Aug 7 '08 #10
lee123
556 512MB
well after doing what you told me it still doesn't work now my code looks like this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub WindowsMediaPlayer1_StatusChange()
  2.     If WindowsMediaPlayer1.Status = "Finished" And List1.ListIndex < (List1.ListCount - 1) Then
  3.         List1.ListIndex = List1.ListIndex + 1
  4.         WindowsMediaPlayer1.URL = List1.List(List1.ListIndex)
  5.     End If
  6. End Sub
is this wrong or do i stick the piece of code you have presented in your last entry in the listbox it self like this

Expand|Select|Wrap|Line Numbers
  1. Private Sub List1_Click()
  2.     If List1.ListIndex < (List1.ListCount - 1) Then
  3.         List1.ListIndex = List1.ListIndex + 1
  4.     End If
  5.      WindowsMediaPlayer1.URL = List1.Text
  6. End Sub
because both ways don't work. it advances to the next one but it don't play. is that because of the way i have this code?

lee123
Aug 7 '08 #11
lee123
556 512MB
mayby if i show all the code for this you can help me figure out why this won't play after the first one is done

here it is:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Add_Click()
  2.     MyPlayList.AddItem Combo1.Text & "" & Text1.Text
  3. End Sub
  4. Private Sub cmdClear_Click()
  5.     MyPlayList.Clear  'To clear the Play list
  6.     Text1.Text = ""
  7. End Sub
  8. Private Sub cmdNext_Click()
  9.     MyPlayList.ListIndex = MyPlayList.ListIndex + 1 'This for to scroll down to the next one
  10. End Sub
  11. Private Sub cmdPrevious_Click()
  12.     MyPlayList.ListIndex = MyPlayList.ListIndex - 1 'This is to scroll to the previous one up
  13. End Sub
  14. Private Sub Dir1_Change()
  15.     File1.Path = Dir1.Path
  16. End Sub
  17. Private Sub Drive1_Change()
  18.     Dir1.Path = Drive1.Drive
  19. End Sub
  20. Private Sub File1_Click()
  21.     Text1.Text = File1
  22. End Sub
  23. Private Sub MyPlayList_Click()
  24.     WindowsMediaPlayer1.URL = MyPlayList.List(MyPlayList.ListIndex)
  25. End Sub
  26. Private Sub WindowsMediaPlayer1_PlaylistChange(ByVal Playlist As Object, ByVal change As WMPLibCtl.WMPPlaylistChangeEventType)
  27.     If MyPlayList.ListIndex = (MyPlayList.ListCount - 1) Then
  28.         WindowsMediaPlayer1_StatusChange
  29.     End If
  30. End Sub
  31. Private Sub WindowsMediaPlayer1_StatusChange()
  32.     On Error Resume Next
  33.     Dim Answer As Integer
  34.     If WindowsMediaPlayer1.Status = "Finished" Then
  35.         Answer = MsgBox("Shall I Continue?", vbQuestion + vbYesNo, "Continue?")
  36.         If Answer <> vbYes Then End
  37.         MyPlayList.ListIndex = MyPlayList.ListIndex + 1
  38.         WindowsMediaPlayer1.URL = MyPlayList.List(MyPlayList.ListIndex)
  39.     End If
  40. End Sub
well there is what i have in this project now how can i get it to play the next one down automatically when a song is done that is loaded in the playlist somebody anybody?

lee123
Aug 9 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

30
by: Robert Tweed | last post by:
Does anyone know a good resource discussing the issues involved in session theft? I've read a couple, but none that really address the problem apart from acknowledging that it is a problem; you...
1
by: Tim Smith | last post by:
In my .cs code I populate set the DataSource appropriately and I can get my DataGrid to appear, though sorting throws an error 'dgDataGrid1__ctl1__ctl0' of type 'DataGridLinkButton' must be placed...
2
by: Susan | last post by:
In C++ you could do something like int key = something; functionCall (key+1); Where the array key would be sent in but the 0 position in the function call would be the first position in the key...
9
by: S0UL | last post by:
I have some difficulties about this que, anyone could help me to solve it...you can use a number of functions and may make use of arrays, structures and enumeration types as you see fit. At a...
2
by: henrywuxg | last post by:
Hi All, I would like to use Period Key(.) besides Tab to toggle from one textbox to another when user is editing IP addresses, which have four textboxes. The function in below works fine with...
6
by: Rig20 | last post by:
Hello, I’m sure this is a relatively easy fix, but I have an unbound combo box on a form that runs numerous queries in the After Update section. Everything there works fine. All I need to do is...
41
by: Steve | last post by:
since people have an affinity to paper copies, printing has become an issue with some reports i'm generating. it seems incovenient to the end-users to have to set the orientation to landscape and...
15
by: =?UTF-8?B?RXJpayBXaWtzdHLDtm0=?= | last post by:
This is a little bit off topic but I hop you'll forgive me. A few days ago some expressed the opinion (in a post I can't find, but it was probably in one of Razii's threads) that Java's iterators...
5
Claus Mygind
by: Claus Mygind | last post by:
I am creating a table dynamically adding lines to the table as the user completes each line. I would like the cursor to appear in the second cell of the new row after it has been created, but I seem...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.