Determine Control Name Dynamically?
Determine Control Name Dynamically?
(OP)
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.
RE: Determine Control Name Dynamically?
Francis
www.controldraw.co.uk
www.s88control.blogspot.com
RE: Determine Control Name Dynamically?
RE: Determine Control Name Dynamically?
Francis
www.controldraw.co.uk
www.s88control.blogspot.com
RE: Determine Control Name Dynamically?
CODE
Then I can use a pair of indices to control which text box I want. Too bad VB2010 doesn't have an OPTION BASE 1 option.