sets the position to 0:
Code:function Replay() LB = "Playlist"; ItemsInListBox = ListBox.GetCount(LB); -- Get the selected items Selected = ListBox.GetSelected(LB); SelectedItem = Selected[1] +1; FileToOpen = ListBox.GetItemData(LB, Selected[1]); ListBox.DeselectItem("Playlist", Selected[1]); file_name = ListBox.GetItemText(LB, SelectedItem); if SelectedItem >= ItemsInListBox then ListBox.SelectItem(LB, 1); -- enable the remove button Button.SetEnabled("Remove", true); -- get the data FileToOpen = ListBox.GetItemData(LB, 1); -- Load the File MediaPlayer.Load("Media", FileToOpen); -- Play the File MediaPlayer.Play("Media"); -- get the lenght and set it as the position Length = MediaPlayer.GetLength("Media") Slider.SetRange("Position", 0, Length); Slider.SetSliderPos("Position", 0); -- start the timer Page.StopTimer(); Page.StartTimer(1000); -- set the position Slider.SetSliderPos("Volume_bar", 50); else ListBox.SelectItem(LB, SelectedItem); FileToOpen = ListBox.GetItemData(LB, SelectedItem); -- Load the File MediaPlayer.Load("Media", FileToOpen); -- Play the File MediaPlayer.Play("Media"); -- get the lenght and set it as the position Length = MediaPlayer.GetLength("Media") Slider.SetRange("Position", 0, Length); Slider.SetSliderPos("Position", 0); -- start the timer Page.StopTimer(); Page.StartTimer(1000); -- set the position Slider.SetSliderPos("Volume_bar", 50); -- tell the user text = String.Concat("Playing next file: ", file_name); INIFile.SetValue("AutoPlay\\Docs\\traytip.ini", "Text", "Value", text); File.Run("AutoPlay\\Docs\\Traytip.exe", "", "AutoPlay\\Docs", SW_SHOWNORMAL, false); end end

