B
Brian Newman
I have a form with five rows of text boxes, displaying data. For
certain reasons, I can't bind these directly to data records, so I'm
using code to load the data into an object, then manually get each
field value and assign it to each text box.
The text boxes are named like this:
txtSPctTrees1 txtSPctShrubs1 txt(etc)1 ...
txtSPctTrees2 txtSPctShrubs2 txt(etc)2 ...
txtSPctTrees3 ...
....
In other languages, I could assign the name of the text box object to
a string variable:
nRowNum = 3
cStr = "txtSPctTrees" & nRowNum.ToString.Trim
Then I could use a variable substitution character in-line to make the
assignment, something like this:
&cStr.Value = oDataRow("Field1")
Can I do anything like that in VB.NET, constructing the name of the
object to reference at runtime from variables?
certain reasons, I can't bind these directly to data records, so I'm
using code to load the data into an object, then manually get each
field value and assign it to each text box.
The text boxes are named like this:
txtSPctTrees1 txtSPctShrubs1 txt(etc)1 ...
txtSPctTrees2 txtSPctShrubs2 txt(etc)2 ...
txtSPctTrees3 ...
....
In other languages, I could assign the name of the text box object to
a string variable:
nRowNum = 3
cStr = "txtSPctTrees" & nRowNum.ToString.Trim
Then I could use a variable substitution character in-line to make the
assignment, something like this:
&cStr.Value = oDataRow("Field1")
Can I do anything like that in VB.NET, constructing the name of the
object to reference at runtime from variables?