1) Declare a class that contains the at least text of the elements and the timing:
class TimedListElement
{
public string caption {get;set;}
public int timing {get;set;}
}
2) Create a list with objects of this kind
List<TimedListelEment> elements = new List<TimedListElements>();
elements.Add(new TimedListElement(){caption = "Firts", timing=5});
elements.Add(new TimedListElement(){caption = "Second", timing=10});
elements.Add(new TimedListElement(){caption = "Third", timing=3});
3) Feed the ListBox with this list:
yourListBox.DataSource = elements;
4) Specify DisplayMember:
yourListBox.DisplayMember = "caption";
yourListBox.ValueMember = "timing";
5) Now, you can use the
SelectedValue[
^] property of the listbox to egt the timing.