Create concatenated string as name for new textbox

dmarkus100

Member
Joined
Jul 11, 2010
Messages
15
Programming Experience
1-3
hi

I am trying to programatically create textboxes in my app.

I need to do this:
dim textbox(x) as new textbox
x needs to loop 1 thru 10 but I can't get VB to accept my coding.

Please help
Thanks
 
The name of a control is set with Name property.
VB.NET:
For x As Integer = 1 To 10
    Dim tb As New TextBox
    tb.Name = "textbox" & x.ToString

Next
 
Back
Top