I don't know what is wrong in Code ..
Please anyone tell me the right code for this project (New Media Player)
Code:
Public Class Form2
' Load Items in PlayList '
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ofd As New OpenFileDialog
ofd.InitialDirectory = "C:\Users\Adminastrator\Desktop"
ofd.Multiselect = True
ofd.ShowDialog()
For I As Integer = 0 To ofd.FileName.Count - 1
ListBox1.Items.Add(ofd.FileNames(I))
ListBox2.Items.Add(ofd.SafeFileNames(I))
Next
If ListBox1.Items.Count = 0 = True Then
MsgBox("Please Load Items", MsgBoxStyle.Critical, "File Error !")
Else
ListBox1.SelectedIndex = 0
ListBox2.SelectedIndex = 0
End If
End Sub
'If Playlist2 Selected Index Changes, Playlist1 Selected Index changes'
Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox2.SelectedIndexChanged
ListBox1.SelectedIndex = ListBox2.SelectedIndex
End Sub
End Class







