You haven't mentioned if this is a Web or Windows app. If it's a Web app, you could use the FindControl method which accepts a string. If it's a Windows app, you will need to recursively walk through the Controls collection of the container to find a control whose name matches the one you want. Other tricks for this include narrowing down the collection as much as possible (use a separate container like a GroupBox for the set of controls in which iteration is to be performed, as well as iterating the collection once and storing all the names and a reference to each control in a HashTable like collection.
On Dec 14, 12:11 am, johnny <[email protected]> wrote: > How to use variable value in name of textbox? > > Hi! > > How to use variable value in name of textbox? > > --------------------- > For X = 1 To 5 Step 1 > For Y = 1 To 5 Step 1 > > boxX_Y .Visible = True > > Next Y > Next X > ------------------ > > boxX_Y .Visible = True > > I want change this to box1_1 box1_2...box2_1... and so on.
