AuthorMessage
b_w_johan
Regular
Posts: 56

Code:

Private Sub Play_Click()
    Text1 = List1.Text
    On Error Resume Next
    MediaPlayer1.URL = Text1.Text
End Sub

So finally got my media player to work.
and now encountering this stupid problem.
when song finished it stops ...
so i need to find out how to move 1 down in the "List1"
and then ill add some option like when mediaplyer.close then Play_.click
so it has selected the song below the one i started.
any idea's how to make it select the one below the selected file in the File1 ??
and then if its at the bottom go to the top again and reloop =-p
b_w_johan
dzadzuks
Ametuar
Posts: 135

maybe this can help u:
Code:
List1.ListIndex = List1.ListIndex + 1

this will select the next item in list  :wink:
so u can make on stop to do this and platy again
b_w_johan
Regular
Posts: 56

ok so i have 3 items
it starts on 1
goes to 2
to 3
and crashes
lol how do i make it go to top if no items are in the list anymore ???
Code:

        List2.SetFocus
        For o = 1 To Winsock1.UBound
            Winsock1(o).SendData sData
            List2.ListIndex = List2.ListIndex + 1
        Next o

b_w_johan
Regular
Posts: 56

Code:
List2.SetFocus
        Text4.Text = List2.ListCount
        For o = 1 To Winsock1.UBound
            Winsock1(o).SendData List2.Text
            List2.ListIndex = List2.ListIndex + 1
        Next o

so i have to do something like
if List2.listindex < Text4.Text
the do the for loop
but if i do it like that its not doing the for loop anymore ....
so i just need it to do the for loop as long as its smaller then Text4.Text
and im trying now since yesterday and can't get it to work so i would really apreciate it if someone could help me in this ;-)
Johan
Meka][Meka
Unstopable
Posts: 700

ok create a form, add a listbox, and button, leave them by defaults, add this code i jus quickly wrote
Code:

Private Sub Command1_Click()
    If List1.ListCount - 1 = List1.ListIndex Then
        List1.ListIndex = -1
    End If
    List1.ListIndex = List1.ListIndex + 1
End Sub
Private Sub Form_Load()
    For i = 1 To 10
        List1.AddItem "test" & i
    Next i
   
    List1.ListIndex = 0
End Sub

and keep clicking the button, gluck, hope it helps...
bluebear
n00b
Posts: 32

I rather go for this:
Code:

Sub Play_All()
  Dim i As Integer
  For i = 0 To List1.ListCount - 1
      List1.ListIndex = i
  Next i
End Sub
'Or manual one
Sub Next_Item()
  If (List1.ListIndex + 1) < List1.ListCount Then
    List1.ListIndex = List1.ListIndex + 1 'Goto next
  Else
    List1.ListIndex = 0 ' Goto start of list ( not sure if 0 or 1 is lowerbound in vb6 )
  End If
End Sub

Meka][Meka
Unstopable
Posts: 700

0 is lowerbound, but IMO
Code:

    If List1.ListCount - 1 = List1.ListIndex Then
        List1.ListIndex = -1
    End If
    List1.ListIndex = List1.ListIndex + 1

is best :-P
b_w_johan
Regular
Posts: 56

hmmz my second question about list1 options hehe
how can i compare fastest ?
should i just do:
if list1 with item1 is equal to text2.text then
'do something
else
List1.ListIndex = List1.ListIndex + 1
go back to step1
or is there some fster way to check in 1 time for duplicate items in a list ??
b_w_johan
Regular
Posts: 56

its for a banlist to be more specific i check IP of connecting users with the one in the banlist or is there another way to do banning without comparing to that list ... i guess not but now you know what i was planning to do with the comparing ..
bluebear
n00b
Posts: 32

You might wanna use a collection or a array for banlist
Code:
  Dim banList As New Collection
  banList.Add "data", "Key"