Calling a label with a variable (SOLVED)

Feb 26 2014 7:33 AM
I will need to do a lot of similar coding for different labels, and I was wondering how to call a label without having it write it's name entirely, but using a variable.
I need to use a variable anyway, so I figured I would just call the labels something similar.
For instance: Variable Cookie needs to be 1100, and I, elsewhere, need to call the label associated with the number 1100. So let's say I call the label label1100.
the Cookie variable could also be 2200 or 2100 or 1400, and those have associated labels as well (label2200, label2100, label1400)
How do I call the associated label, without having to write the name of the exact label?
I'm thinking something like this (of course this won't work, this is just how it looks in my head):
Label TheLabel = (Label)"label" + Cookie;
TheLabel.Show();

Answers (2)