Show a Panel based on a String value

MDEnt

Member
Licensed User
Longtime User
I'm wondering what the recommendation is to show a Panel based on using a string value.

For example If I have strings defined: page1, page2, etc. - and a specific panel created that I want to show for each - how would I set panel visible to true based the current string name. I'm trying to avoid using a bunch of if/then and strictly use the string name for the panel

I'm hoping to use the string value for the panel name itself or perhaps use the tag property to set the view. I've tried a few things and have some syntax problems - but in brief - a semi-straight forward example of the goal below...

currentpage = page1 'set the string value
currentpage.Visible = True 'show the panel based on string name
 

kickaha

Well-Known Member
Licensed User
Longtime User
Use a map, with the panel name as the key, and the panel as the value.

You can then get the using the .get, using the name.
 
Upvote 0
Top