Dim TeamAScoreCollection As New Collection
Dim TeamBScoreCollection As New Collection
Dim objtextbox As New Textbox
'set scores in all Team A textboxes to 0
For each objtextbox in TeamAScoreCollection
objtextbox.Text="0"
Next objtextbox
'set scores in all Team B textboxes to 0
For each objtextbox in TeamBScoreCollection
objtextbox.Text="0"
Next objtextbox
By this code I have 2 collection variables that control a bunch of textboxes. Now rather than write 2 separate For Each loops, to write 0 in all the textboxes, how can I do it in ONE loop?
I have tried using the operators like And but apparently you cant do that. Any suggestions?
Enter your message below
Sign in or Join us (it's free).