I have a listbox that, when a button is pressed, the next item in the index is selected. Once the final result is reached, that one result is continuously selected. How would I get my program to go back to the top and select the first item after reaching the final result of the listbox?
private void NextBtn_Click(object sender, EventArgs e)
{
NextBtn.Enabled = false;
if (Playlist.SelectedIndex<Playlist.Items.Count - 1)
{
Playlist.SelectedIndex = Playlist.SelectedIndex + 1;
}
}