davidbeach
Electrical
- Mar 13, 2003
- 9,483
Working on a project where I have multiple similarly named controls, Text Boxes in this case, where I want to build the control name in code and then assign the value.
For instance I have text boxes:
TB_A_1_1
TB_A_2_1
TB_A_1_2
TB_A_2_2
And I have the text that needs to go into those text boxes in a 2x2 string array. What I'd like to do is, within a set of loops, have one equation that would function as
TB_A_i_j.Text = Array(i,j)
Of course it doesn't seem to be that easy. Is there some way of doing this, or do I have to brute force it and have multiple IF statements (or other construct)?
Working in the VB portion of Visual Studio 2010.
For instance I have text boxes:
TB_A_1_1
TB_A_2_1
TB_A_1_2
TB_A_2_2
And I have the text that needs to go into those text boxes in a 2x2 string array. What I'd like to do is, within a set of loops, have one equation that would function as
TB_A_i_j.Text = Array(i,j)
Of course it doesn't seem to be that easy. Is there some way of doing this, or do I have to brute force it and have multiple IF statements (or other construct)?
Working in the VB portion of Visual Studio 2010.