Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools


Click here to copy the following block
' Returns an array with all the controls in the specified container control and
' its child containers
' Example:
'  ' print the name of all the controls on the form and its child container
' controls
'  Dim ctl As Control
'  For Each ctl In GetAllControls(Me)
'    Debug.WriteLine(ctl.Name)
'  Next

Function GetAllControls(ByVal container As Control) As Control()
  Dim al As New ArrayList
  Dim ctl As Control
  For Each ctl In container.Controls
    GetAllControlsHelper(ctl, al)
  Next
  Return al.ToArray(GetType(Control))
End Function

Sub GetAllControlsHelper(ByVal container As Control, ByVal al As ArrayList)
  ' add this control to the ArrayList
  al.Add(container)
  ' add all its child controls, by calling this routine recursively
  Dim ctl As Control
  For Each ctl In container.Controls
    GetAllControlsHelper(ctl, al)
  Next
End Sub


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.