📅  最后修改于: 2022-03-11 14:48:39.199000             🧑  作者: Mango
string selected = listBox1.SelectedItem.ToString();
int id = int.Parse(selected.Split(' ')[0]); // we are using dictionary and spliting the item in listbox and as spliting parametar we are using space
Car cars = car[id];
textBox1.Text = id.ToString();
textBox2.Text = cars.manufacturer;
textBox3.Text = cars.model;
pictureBox1.ImageLocation = cars.picture;
//by iq18but18cm