Pokousim se udelat stupidni MP3 prehravac a nedari se mi zprovoznit toto: Mam listbox a dve tlacitka (dalsi a predchozi) a potrebuji aby se pomoci techto tlacitek dalo v listboxu pohybovat. Neco uz mam, ale kdyz klepnu na dalsi tak sice listbox preskoci na dalsi policko, ale soubor se neprehraje... Zde je zdrojak:
Public Class Form1
Dim Selected As String
Dim soubor As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Playlist.SelectionMode = SelectionMode.One
Playlist.ScrollAlwaysVisible = True
End Sub
Private Sub OtevřítToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OtevřítToolStripMenuItem.Click
otevrit.Filter = "mp3 soubory(*.mp3)|*.mp3"
otevrit.ShowDialog()
soubor = otevrit.FileNames(0)
mmcMp3.DeviceType = "MPEGVideo" '\\Change MCI device type to MPEG
mmcMp3.FileName = soubor '\\designate file to be played
mmcMp3.Command = "Open" '\\Open file for playing
mmcMp3.Command = "Play" '\\Play file
Playlist.DataSource = otevrit.FileNames
End Sub
Private Sub mmcMp3_NextClick(ByVal sender As System.Object, ByVal e As AxMCI.DmciEvents_NextClickEvent) Handles mmcMp3.NextClick
Playlist.SelectedIndex += 1
End Sub
Private Sub Playlist_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Playlist.SelectedIndexChanged
mmcMp3.Command = "Stop"
mmcMp3.Command = "close"
mmcMp3.FileName = Playlist.SelectedItem '\\designate file to be played
mmcMp3.Command = "Open" '\\Open file for playing
mmcMp3.Command = "Play" '\\Play file
Nowplay.Text = Playlist.SelectedItem
End Sub
Private Sub mmcMp3_PrevClick(ByVal sender As System.Object, ByVal e As AxMCI.DmciEvents_PrevClickEvent) Handles mmcMp3.PrevClick
End Sub
End Class
Předem díky