Results 1 to 4 of 4

Thread: For Each loop [RESOLVED]

  1. #1

    Thread Starter
    Addicted Member Zealot's Avatar
    Join Date
    Jul 2002
    Location
    Lisboa, Portugal
    Posts
    206

    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.
    Last edited by Zealot; Feb 25th, 2003 at 03:13 PM.

  2. #2

    Thread Starter
    Addicted Member Zealot's Avatar
    Join Date
    Jul 2002
    Location
    Lisboa, Portugal
    Posts
    206
    What the hell... no one has worked with collection controls in vb.net before?

  3. #3
    Member
    Join Date
    Sep 2002
    Posts
    37
    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

  4. #4

    Thread Starter
    Addicted Member Zealot's Avatar
    Join Date
    Jul 2002
    Location
    Lisboa, Portugal
    Posts
    206
    Hey it did, thanks a lot!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width