[RESOLVED] Iterate through several text boxes using loop
In Visual Studio 2005, is it possible to assign to an array a set of existing text boxes, then use that array in a loop to sum up the numeric values in the text boxes? I want to do this for specific text boxes, not every text box on the form. Or does this have to be done with a line of code for each text box?
Thanks.
Jerry
Re: Iterate through several text boxes using loop
Create the array exactly as you would any other array:
vb.net Code:
Me.textBoxes = New TextBox() {Me.TextBox1, Me.TextBox2, Me.TextBox3}
Once that's done you can loop through it anywhere you like.
Re: Iterate through several text boxes using loop
This works. Thank you. You've added to my skills so that I can manage several or many controls using an array, as with an array of text boxes.
Jerry