C#C
C#4y ago
Grin

How to call a function when you don't know what function to call?

I'm making a small guessing game to learn more about methods. I want to use picture boxes for states and am utilizing a class that stores the state number, name, and name of the picture box. I have a random number between 1 & 50 that chooses the state. When that number is determined I want a foreach(iteration in state) to go through the state numbers and find the correct state to enable (make the picture of the state visible) with a pictureName.Visibible = true but this doesn't seem possible. Can anyone point me in a good direction on how to handle this?
Capture.PNG
Was this page helpful?