Results 1 to 5 of 5

Thread: [RESOLVED] Get all information about all controls

  1. #1

    Thread Starter
    Hyperactive Member demon.KILER's Avatar
    Join Date
    Jul 2006
    Location
    I cannot remember !?
    Posts
    408

    Resolved [RESOLVED] Get all information about all controls

    hi all

    I need help to get all information about all controls in my form like their bgcolor ,location , forecolor etc


    thx for future help
    VS 2005 .....Framework SDK 3.0

    "Its mostly the brave one who choose to not fight"

  2. #2

    Thread Starter
    Hyperactive Member demon.KILER's Avatar
    Join Date
    Jul 2006
    Location
    I cannot remember !?
    Posts
    408

    Re: Get all information about all controls

    sry I found it
    Last edited by demon.KILER; Dec 10th, 2006 at 09:10 PM.
    VS 2005 .....Framework SDK 3.0

    "Its mostly the brave one who choose to not fight"

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Get all information about all controls

    I'd suggest that you check out my submission in the VB.NET CodeBank forum that walks the control tree in a form without explicit recursion. You could also use explicit recursion if you want it to be a bit more efficient, although it won't follow the tab order then, e.g.
    VB Code:
    1. Private Sub DisplayControlNames(ByVal controls As ControlCollection)
    2.     For Each cntrl In Controls
    3.         MessageBox.Show(cntrl.Name)
    4.  
    5.         'Here's the recursive step to access nested controls.
    6.         Me.DisplayControlNames(cntrl.Controls)
    7.     Next cntrl
    8. End Sub
    You would call it like this:
    VB Code:
    1. Me.DisplayControlNames(Me.Controls)
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Hyperactive Member demon.KILER's Avatar
    Join Date
    Jul 2006
    Location
    I cannot remember !?
    Posts
    408

    Re: Get all information about all controls

    that work too thx man
    VS 2005 .....Framework SDK 3.0

    "Its mostly the brave one who choose to not fight"

  5. #5
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Get all information about all controls

    Quote Originally Posted by demon.KILER
    that work too thx man
    Get the solution then resolved the thread by clicking the thread tool menu

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