Hi,
I'm a newbie to VB.NET - I studied VB 5&6 in college, but I've mostly forgotten about it. Anyhow, on my university human-computer interaction course I've got to make an MP3 player with playlist capability.
I am using a DriveListBox, DirListBox and FileListBox to select the file to add to the playlist - however the problem arises when I actually try to add the file. The doubleclick method is meant to take the file's path and insert it into the listview on the other form.
Sorry if that's a bit messy. Anyhow, when I double click the item in the filelistbox at runtime I get an error saying:
An unhandled exception of type 'System.NullReferenceException' occurred in Mp3player1.exe
Additional information: Object reference not set to an instance of an object.
I must admit I don't understand much about object orientation etc. - I didn't pay much attention in class! So I don't really know why I'm getting this error. Also, I don't really know what information would be useful to you in diagnosing the problem - don't hesitate to ask for more info should it be needed.
Thanks,
Andrew
I'm a newbie to VB.NET - I studied VB 5&6 in college, but I've mostly forgotten about it. Anyhow, on my university human-computer interaction course I've got to make an MP3 player with playlist capability.
I am using a DriveListBox, DirListBox and FileListBox to select the file to add to the playlist - however the problem arises when I actually try to add the file. The doubleclick method is meant to take the file's path and insert it into the listview on the other form.
VB.NET:
Private Sub FileListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileListBox1.DoubleClick
OtherForm.lst_playlist.Items.Add(New ListViewItem(FileListBox1.Path.ToString)) 'Supposed to add that to the playlist on form1
End Sub
Sorry if that's a bit messy. Anyhow, when I double click the item in the filelistbox at runtime I get an error saying:
An unhandled exception of type 'System.NullReferenceException' occurred in Mp3player1.exe
Additional information: Object reference not set to an instance of an object.
I must admit I don't understand much about object orientation etc. - I didn't pay much attention in class! So I don't really know why I'm getting this error. Also, I don't really know what information would be useful to you in diagnosing the problem - don't hesitate to ask for more info should it be needed.
Thanks,
Andrew