Results 1 to 3 of 3

Thread: Question about For Loop?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Location
    Atlanta Ga.
    Posts
    177

    Question about For Loop?

    What application could the For Loop be used on? When could this be useful in a program? How could the for loop be used when looping through a collection of controls?

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: Question about For Loop?

    Originally posted by wmosley2
    How could the for loop be used when looping through a collection of controls?
    If the Control dosn't have a Parent, then you can do:

    VB Code:
    1. Dim ctl As Control
    2.  
    3.   For Each ctl In Controls
    4.       If TypeOf ctl Is TextBox Then
    5.           MsgBox ctl.Name
    6.       End If
    7.   Next

  3. #3
    Hyperactive Member dogfish227's Avatar
    Join Date
    Oct 2002
    Location
    GA
    Posts
    409

    this site is not for doing yopur HW

    i remeber that exact question from CompSci 1n2 this we will not do your HW for u should should be able to figure this out on your own theres a million and 1 way that a for loop is use full

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