-
For Each loop [RESOLVED]
First I'd like you all to know that I tried to use the search, but it's clearly offline, since it doesn't give me any result at the time I'm writting this.
Now, I have about 8 textboxes inside a tab control wich is inside a panel. What I'd like to do is a procedure that clears the text in all the textboxes. In VB 6 it's really simple and intuitive, but in VB.Net I really can't understand it. I can't understand the Studio help either.
So could anyone post the little code needed to automate the txtBlablabla.Text = "" instruction?
Oh, the textboxes aren't as in an array.
I'm a bit ashamed to ask for help for such a simple task, but I already lost 3 hours with this. :(
-
What the hell... no one has worked with collection controls in vb.net before? :confused:
-
Hi
Will this help?
Dim ctrl As Control
For Each ctrl in Me.TabControl1.TabPages(0).Controls
If TypeOf(ctrl) Is TextBox Then
ctrl.Text = ""
EndIf
Next
Harold Hoffman
-
Hey it did, thanks a lot! :)