Results 1 to 4 of 4

Thread: [RESOLVED] [2005] Question about looping through controls

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Resolved [RESOLVED] [2005] Question about looping through controls

    When looping through controls inside of a container, what is the logic behind the order of each control being looped?

    Basically I have about 5 checkboxes in a container and I am looping through them all to find which is checked, but it seems it is looping from the bottom to the top, is there anyway to change the order or am I missing a property that might change it?

    Thanks

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [2005] Question about looping through controls

    Just from my observation, it seems that:
    1. If the controls are added at design time, the loop will be in reverse of the order that they were added to the controls collection.
    2. If the controls are added at run time (dynamically), the loop will loop in the same order they were added to the control collection.
    Can anyone confirm this?
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  3. #3
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: [2005] Question about looping through controls

    It depends on the order in which they are declared in the designer code.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: [2005] Question about looping through controls

    thanks for the responses...

    They're static controls so I had to change the order of the .add method for each of the controls in the designer code.

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