Trying to change color of label through an array which doesn't work?
<p>I'm trying to make a loop to check if certain files exist, and if they do they're going to change an indicator label on my form, but I can't seem to work out how to do this w/out typing out every single one manually such as this:</p>

<pre><code>        if (File.Exists("C:\\MonitorFiles\\BOT-PC-8is1.txt"))
        {
            PC8IS1.BackColor = Color.Green;
        }
        if (File.Exists("C:\\MonitorFiles\\BOT-PC-8is2.txt"))
        {
            PC8IS2.BackColor = Color.Green;
        }
        if (File.Exists("C:\\MonitorFiles\\BOT-PC-8is3.txt"))
        {
            PC8IS3.BackColor = Color.Green;
        }
</code></pre>

<p>I've tried several very basic ways of just building arrays and substituting but I can't put " VariableX.backcolor ", I've tried [variable].backcolor, no dice.</p>

<p>This is a hard one to search for on google, and hopefully has an easy answer!</p>

<p>Thanks</p>
