Quick question... I have 4 strings which hold colours that represent the BackColors of 4 buttons. They are Red, Blue, Green and Black and lets say the are called. Col1, Col2, Col3 and Col4. These values will be subject to change but not to any specific colours which is why they are stored in strings.
Now I know this works....
[VB]
Button1.BackColor = Color.Red
Button2.BackColor = Color.Blue
Button3.BackColor = Color.Green
Button4.BackColor = Color.Black
[/VB]
But if I try this...
[VB]
Button1.BackColor = Color.Col1
Button2.BackColor = Color.Col2
Button3.BackColor = Color.Col3
Button4.BackColor = Color.Col4
[/VB]
...it doesnt work. To be honest I didnt expect it to.
I there a simple way to do this or will I have to resort to a massive If... block?
Now I know this works....
[VB]
Button1.BackColor = Color.Red
Button2.BackColor = Color.Blue
Button3.BackColor = Color.Green
Button4.BackColor = Color.Black
[/VB]
But if I try this...
[VB]
Button1.BackColor = Color.Col1
Button2.BackColor = Color.Col2
Button3.BackColor = Color.Col3
Button4.BackColor = Color.Col4
[/VB]
...it doesnt work. To be honest I didnt expect it to.

I there a simple way to do this or will I have to resort to a massive If... block?