I was wondering if there was a way executing code for an element contained in a string. To be more clear, here is an example :
string elementToHide = "welcomePanel";
elementToHide.Visible = false;
What I'm doing here is simple, I have an element stored in a string, and I want to hide this specific element contained in the string : here I want to hide a panel called "welcomePanel" for example.
Is this possible ? Maybe not with a string but with something else ?
Thanks !
Edit : I solved this by using the following code :
string elementToHide = "welcomePan";
((Panel)this.Controls.Find(elementToHide, true)[0]).Visible = false;