Results 1 to 6 of 6

Thread: Looping through controls & forms

  1. #1

    Thread Starter
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051

    Looping through controls & forms

    When i loop through all the controls on a form using a for each loop, is the order consistant, providing the number of controls are constant?

    Also, how would i loop through all forms in a program (may or may not be MDIChild/MDI forms?

    It goes without saying that i'm thankfull for any replies, but to reitterate, i'm thankfull for any replies
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    To loop through all the forms:
    VB Code:
    1. For Each frm in Forms
    2. 'Do whatever you want with this form (frm)
    3. Next
    Baaaaaaaaah

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    SLH, my guess is that the order is consistant, I tried find something in the MSDN regarding the subject, but was not able to

    why do u need to know ?
    -= a peet post =-

  4. #4

    Thread Starter
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    Originally posted by peet
    why do u need to know ?
    I've made a custom tooltip, where it fades in. The speed at which it fades in, depends on how much the user needs the info (from the tooltip). I need to beable to store the speed for each control that has a tooltip.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  5. #5
    Hyperactive Member Jason Badon's Avatar
    Join Date
    Feb 2001
    Location
    Colorado
    Posts
    329
    give this a try I don't know if it will work with MDI or not you will have to give it a try

    VB Code:
    1. Public Sub SetFormColors()
    2.     On Error GoTo error
    3.     Dim Frm As Form
    4.     Dim Ctl As Control
    5.    
    6.     For Each Frm In Forms
    7.         Frm.BackColor = vbRed
    8.         For Each Ctl In Frm.Controls
    9.             Ctl.BackColor = vbRed
    10.         Next Ctl
    11.         Frm.Show
    12.     Next Frm
    13.    
    14.     Exit Sub
    15. error:
    16.     Err.Clear
    17.     Resume Next
    18. End Sub

  6. #6

    Thread Starter
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    Thanks all
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


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