|
-
Nov 6th, 2007, 06:18 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [02/03] Convert Variable Contents to Control Name
I have several panels on a form. I get a datareader from a table that gives me the names of the panels on the form (you'll see why in a second).
The dataset writes its data to a infrogistics datagrid, along with other info such as Item ID.
Now, based on the panel name on the selected row, I want to make visible that panel and hide the rest.
I can get the contents of the cell, within which holds the name of the panel I want to display. However, I need to access the Visible property of a control with the variable contents as its name.
For example, the cell contains "Panel1". I need to do this
Code:
Panel1.Visible = True
To hide the remaining panels I can do a For Each loop.
Unfortunately a Select Case statement won't do because the whole point of the exercise is to not include hard-coded control names.
The panels can be added any time with different data on them, but I need to only put the new panel on the form, and an entry in the database for the Item ID that tell the app which Panel to show.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|