C# Resource Array

Posted by user472875 on Stack Overflow See other posts from Stack Overflow or by user472875
Published on 2010-12-27T00:59:08Z Indexed on 2010/12/27 1:54 UTC
Read the original article Hit count: 557

Filed under:
|

Hi,

I have a bunch of pictures I'm using in a C# project, and I'm trying to initialize them all for later use. There are over 50 of them and they all have the same name format Properties.Resources._#, where # is the picture number. What I'm trying to do is something like:

for(int i = 0; i < 100; i++) {
   pics[i] = Properties.Resources._i;
}

How would I go about embedding the index into the name?

Thanks, and happy holidays.

EDIT: Just realized that if I had a way to embed the index in the name, I could just have a function that returns the specific picture based on the number given, so that would work too.

© Stack Overflow or respective owner

Related posts about c#

Related posts about resources