Search in imagelist and show in picturebox

  • Thread starter Thread starter KeesBlunder
  • Start date Start date
K

KeesBlunder

Guest
I have a Imagelist4 with 70 country flags.

I want to use this to show in Picturebox20.

If ComboBox37.Text = ("Nederland") Then
PictureBox20.Image = ImageList4.Images(47)
Else
PictureBox20.Image = Nothing
End If
This works , but is there a beter way to do this . Because else i have to do this 70 times.


Maybe to search in this list with the country's and then find the image index ?

How do i combine this , and where do i put this list


"Antiqua and Barbuda",1, ImageIndex = 0})
"Albanië",2, ImageIndex = 1})
"Andorra",3, ImageIndex = 2})
"Australia",4, .ImageIndex = 3})
"Bahamas",5, .ImageIndex = 4})
"Bahrain",6, .ImageIndex = 5})
"Barbados",7, .ImageIndex = 6})
"Belgium",8, .ImageIndex = 7})
"Bermuda",9, .ImageIndex = 8})
"Bosnia and Herzegovinia",10, .ImageIndex = 9})
"Bulgaria",11, .ImageIndex = 10})
"Canada",12, .ImageIndex = 11})
"Cayman Islands",13, .ImageIndex = 12})
"China",14, .ImageIndex = 13})
"Cypres",15, .ImageIndex = 14})
"Denmark",16, .ImageIndex = 15})
"Estonia",17, .ImageIndex = 16})
"Faroe Islands",18, .ImageIndex = 17})
"Finland",19, .ImageIndex = 18})
"France",20, .ImageIndex = 19})
"Germany",21, .ImageIndex = 20})
"Georgia",22, .ImageIndex = 21})
"Gibraltar",23, .ImageIndex = 22})
"Greece",24, .ImageIndex = 23})
"Hong Kong",25, .ImageIndex = 24})
"Hungary",26, .ImageIndex = 25})
"Iceland",27, .ImageIndex = 26})
"India",28, .ImageIndex = 27})
"Indonesia",29, .ImageIndex = 28})
"Iran",30, .ImageIndex = 29})
"Ireland",31, .ImageIndex = 30})
"Isle of Man",32, .ImageIndex = 31})
"Italy",33, .ImageIndex = 32})
"Japan",34, .ImageIndex = 33})
"Korea",35, .ImageIndex = 34})
"Kroatië",36, .ImageIndex = 35})
"Kuwait",37, .ImageIndex = 36})
"Liberia",38, .ImageIndex = 37})
"Letland",39, .ImageIndex = 38})
"Liberia",40, .ImageIndex = 39})
"Liechtenstein",41, .ImageIndex = 40})
"Lithuania",42, .ImageIndex = 41})
"Luxembourg",43, .ImageIndex = 42})
"Madeira",44, .ImageIndex = 43})
"Malaysia",45, .ImageIndex = 44})
"Malta",46, .ImageIndex = 45})
"Marshall Islands",47, .ImageIndex = 46})
"Netherlands",48, .ImageIndex = 47})
"Monaco",49, .ImageIndex = 48})
"Norway",50, .ImageIndex = 49})
"Panama",51, .ImageIndex = 50})
"Philippines",52, .ImageIndex = 51})
"Poland",53, .ImageIndex = 52})
"Portugal",54, .ImageIndex = 53})
"Romania",55, .ImageIndex = 54})
"Russia",56, .ImageIndex = 55})
"San Marino",57, .ImageIndex = 56})
"Slovenia",58, .ImageIndex = 57})
"Slovakia",59, .ImageIndex = 58})
"Singapore",60, .ImageIndex = 59})
"St Vincent & Grenadines",61, .ImageIndex = 60})
"Spain",62, .ImageIndex = 61})
"Sweden",63, .ImageIndex = 62})
"Switzerland",64, .ImageIndex = 63})
"Thailand",65, .ImageIndex = 64})
"Tjechië",66, .ImageIndex = 65})
"Turkey",67, .ImageIndex = 66})
"Ukraine",68, .ImageIndex = 67})
"United Kingdom",69, .ImageIndex = 68})
"United States",70, .ImageIndex = 69})
"Vietnam",71, .ImageIndex = 70})

Continue reading...
 

Similar threads

Back
Top