Problem in vb.net

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
User avatar
Dagger13





Posts: 370
Joined: Wed Nov 22, 2006 12:37 pm

Problem in vb.net

Post by Dagger13 »

Ok so im making a program all it is is a music player,ok so i made it so when i click add folder it will add the music in that folder and show the name,lenght,artist,album, and year in the listview for all songs
and when i click to play a song it works but then when i click another song
i get an error (it dosnt matter witch song)the error says
InvalidArgument=Value of '0' is not valid for 'index'.
Parameter name: index
and what im doing is making the music player read the selected items tooltip(because it shows full filename)


and this is what im using for code that messes up

Code: Select all

 Me.AxQTControl1.FileName = lv.SelectedItems.Item(0).ToolTipText
ik that part is easy
Image(An Old one.)
User avatar
Andrew_b




Socialist

Posts: 4188
Joined: Sat Feb 24, 2007 4:52 pm
Contact:

Post by Andrew_b »

wont that only play item 0?
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

@Andrew_b: No, as it's the array of selected items, it'll be the first one selected.

@Dagger: You may be trying to grab from the selection before it exists. Check that there are any items selected (that the array isn't empty) before referencing anything by index.
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
Andrew_b




Socialist

Posts: 4188
Joined: Sat Feb 24, 2007 4:52 pm
Contact:

Post by Andrew_b »

FleetAdmiralBacon wrote:@Andrew_b: No, as it's the array of selected items, it'll be the first one selected.
Ok, that makes sense.
User avatar
Dagger13





Posts: 370
Joined: Wed Nov 22, 2006 12:37 pm

Post by Dagger13 »

Lol ok thx AdmiralBacon
all i had to do was make it so when i double click it it would do what i want it to.

Thanks :D
Image(An Old one.)
Post Reply