Hi,
I have this problem:
This program adds a number of textboxes (depends on intTotal given by user):
For i = 0 To intTotal - 1
Dim newTextBox As New TextBox
newTextBox.ID = "txtDetail" & (i + 1).ToString
form1.Controls.Add(newTextBox)
Next
The above code works fine. But when it comes to assigning a value to each textbox in other function, I have no idea. Here is what I want to do:
If intTotal = 1
txtDetail1 = "1"
If intTotal = 2
txtDetail1 = "1"
txtDetail2 = "2"
and so forth..
I'm thinking of using For loop, but how do I name each textbox in code behind when the textbox is created in runtime?
For i = 0 To Convert.ToInt32(oTotalVar) - 1
"txtDetail" & i = ??????
Next
Thanks in advance for any help or suggestion.