473,545 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

advancing

lee123
556 Contributor
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 2475
debasisdas
8,127 Recognized Expert Expert
try to increase the listindex by 1.
Aug 5 '08 #2
lee123
556 Contributor
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 Contributor
By the way i am using vb6 and a windows media player in my project

lee123
Aug 5 '08 #4
QVeen72
1,445 Recognized Expert Top Contributor
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 Contributor
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 Recognized Expert Expert
try using this

List1.ListIndex = List1.ListIndex + 1
WindowsMediaPla yer1.URL = List1.list(list 1.listindex)



do not forget to check listcount before incrementing the listindex
Aug 6 '08 #7
lee123
556 Contributor
so do i put this in the WindowsmediaPla yer
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 Contributor
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 Recognized Expert Top Contributor
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

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

Similar topics

30
3949
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 just don't seem to be able to do much about it. Does anyone have some tried-and-tested measures for preventing session theft, that aren't already...
1
1347
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 inside a form tag But ignoring that, with my asp:DataGrid how can I have a column of values each with a link e.g. <a href="Details.aspx?id=" +...
2
1212
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 array. Is there a way to do this in C# without creating a temp array to send in to the functionCall? Thank you, Susan
9
2944
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 certain college, a small parking lot is arranged in a rectangular shape, with 20 spaces numbered 1, 2, 3..... 19, 20. Traffic flow is one way in a...
2
3119
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 IE5, but it has strange problem with Firefox 1.5.0.8. <!-- <td>IP Address <input type="text" size="3" maxlength="3" name="ip_1"
6
13556
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 have a command button on the form that advances the focus of the combo box to the next record in the query its row source is based on (plus I’m sure...
41
1620
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 their margins to 0.25 - which results in a beautiful report. they want a link to download a pdf version that fills all of their needs/wants -...
15
1890
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 were better than C++ iterators, or at least that the Java iterator concept was better (or something to that effect). I would be interested to hear...
5
1330
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 to have some problems with that. At this point I am not even using the variable cNextLine I am just trying to advance to the 2nd cell in the 2nd...
0
7490
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7682
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7935
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6009
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3465
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1911
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.