Results 1 to 4 of 4

Thread: Coding Looping

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    2

    Coding Looping

    I am having trouble coding the Do...While...Loop statement. The program is supposed to loop through the labels and text boxes to count how many there are, then it has to add the value that is inside the labels and text boxes. Having four seperate buttons for how many labels, how many text boxes, the value inside the labels, and the value inside the text boxes. I was wondering if you had any advice that can help me, thank you.

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    why not using For Each Next statment instead of that.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    You will need to use TypeOf
    VB Code:
    1. Dim Ctrl As Control
    2. For each Ctrl in Me.Controls
    3. If TypeOf Cntrl is Label Then
    4. 'do whatever
    5. ElseIf TypeOf Cntrl is TextBox Then
    6. 'do something else
    7. End If
    8. Next

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    2

    Reply on coding looping

    Thank you for the reply

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