/// <summary> /// If SelectedIndexChanged current image in Panel is changed /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void IListBox_SelectedIndexChanged(object sender, EventArgs e) { indexer = IListBox.SelectedIndex == -1 ? 0 : IListBox.SelectedIndex; string locale = PhotoList.File(IListBox.Items[indexer].ToString()); if (!string.IsNullOrWhiteSpace(locale)) { Slider.BackgroundImage = Image.FromFile(locale); } }