Сделать этот код работать быстрее, вместо того, чтобы использовать элемент с listsbox в VB.NET
Это занимает слишком много времени для каждого выбора элементов в списке... Я ищу более быстрый способ загрузить 36 изображений в графические поля своей формы
Что я уже пробовал:
If ListBox2.Items.Count > 36 Then ListBox2.SelectedIndex = 0 PictureBox1.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 1 PictureBox2.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 2 PictureBox3.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 3 PictureBox4.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 4 PictureBox5.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 5 PictureBox6.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 6 PictureBox7.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 7 PictureBox8.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 8 PictureBox9.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 9 PictureBox10.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 10 PictureBox11.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 11 PictureBox12.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 12 PictureBox13.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 13 PictureBox14.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 14 PictureBox15.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 15 PictureBox16.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 16 PictureBox17.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 17 PictureBox18.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 18 PictureBox19.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 19 PictureBox20.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 20 PictureBox21.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 21 PictureBox22.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 22 PictureBox23.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 23 PictureBox24.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 24 PictureBox25.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 25 PictureBox26.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 26 PictureBox27.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 27 PictureBox28.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 28 PictureBox29.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 29 PictureBox30.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 30 PictureBox31.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 31 PictureBox32.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 32 PictureBox33.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 33 PictureBox34.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 34 PictureBox35.Image = Image.FromFile(ListBox2.SelectedItem) ListBox2.SelectedIndex = 35 PictureBox36.Image = Image.FromFile(ListBox2.SelectedItem) Else ' End If