Results 1 to 6 of 6

Thread: [RESOLVED] For Each...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    North Carolina
    Posts
    734

    [RESOLVED] For Each...

    Anyone know of a method that would achieve the following:

    VB Code:
    1. For Each property in AGivenForm
    2.  
    3. Next

    Thanks!
    Last edited by dsheller; Sep 15th, 2004 at 10:09 PM.

  2. #2
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713
    Something like this? Iterate through the items in the collection.
    VB Code:
    1. Dim i as integer
    2.  
    3. For i = 1 to Controls.Count
    4.     Debug.Print Controls.Item(i).Name
    5. Next
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,425
    Hi Rob,

    My reading was he wanted the .Properties of a Form.


    I can give you some code that will extract properties and methods of ALL controls from within VB if that is any help - it comes out as a textfile.




    Bruce.
    Handy References:
    MSDN Library
    ADO Tutorial Excel Tutorial MZTools (VB6)

    • Please pull down the Thread Tools menu and click the 'Mark Thread Resolved' button, or alternately edit your original post and add "Resolved" or place a in the subject when your question(s) have been answered.
    • Please use code tags [highlight=vb] your code goes here between the tags [/highlight] when posting code.

  4. #4
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713
    Hey Bruce, I was reading it as if the poster wanted another
    format for looping throguh a collection, but your probably correct.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,425
    I post the link here anyway, just in case - nice piece of code (Author: MartinSmith)




    Bruce.
    Handy References:
    MSDN Library
    ADO Tutorial Excel Tutorial MZTools (VB6)

    • Please pull down the Thread Tools menu and click the 'Mark Thread Resolved' button, or alternately edit your original post and add "Resolved" or place a in the subject when your question(s) have been answered.
    • Please use code tags [highlight=vb] your code goes here between the tags [/highlight] when posting code.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    North Carolina
    Posts
    734
    That will work, thanks guys.

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