0

As topic. for example. I have a CSV

Code,UserID

USA,1234

JPN,1235

I have added flag image USA.png, and JPN.png into the resource.

My program can read the csv raw data and display correctly but i have problem in calling the flag by reading the country code in my csv.

I tried this:

            Image = Properties.Resources.ResourceManager.GetString.(code)

But doesn't work, how can I achieve this? Thanks

Clemens
  • 123,504
  • 12
  • 155
  • 268
  • Use GetObject(code) method instead of GetString(code). var image = (System.Drawing.Bitmap)Properties.Resources.ResourceManager.GetObject(code); then convert bitmap source to image source. – Maulik Parmar Nov 16 '16 at 09:54
  • @MaulikParmar That is not necessary at all. In WPF you don't deal with bitmap resources as you do in WinForms. – Clemens Nov 16 '16 at 11:38

0 Answers0