One of many ways to get all of a specific type of a control on a form or other container

The following function GetAll is but one of many ways to get a specific type control on a form no matter of it's container i.e. a TextBox in a GroupBox and the GroupBox is in another container such as a panel.

Code:
Public Class Form1
    Public Function GetAll(ByVal sender As Control, ByVal T As Type) As IEnumerable(Of Control)
        Dim controls = sender.Controls.Cast(Of Control)()
        Return controls.SelectMany(
            Function(ctrl) GetAll(ctrl, T)).Concat(controls).Where(
            Function(c) c.GetType() Is T)
    End Function
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        GetAll(Me, GetType(TextBox)).ToList.ForEach(
            Sub(c)
                Console.WriteLine("{0}.{1}", c.Parent.Name, c.Name)
            End Sub)
    End Sub
End Class
Would recommend placing the function in a class or code module rather than in a form where the above is doing so for simplicity.

Example as a language extension method
Code:
Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.GetAll(GetType(TextBox)).ToList.ForEach(
            Sub(c)
                Console.WriteLine("{0}.{1}", c.Parent.Name, c.Name)
            End Sub)
    End Sub
End Class
Extension method
Code:
Public Module Extensions
    <System.Diagnostics.DebuggerStepThrough()> _
    <System.Runtime.CompilerServices.Extension()> _
    Public Function GetAll(ByVal sender As Control, ByVal T As Type) As IEnumerable(Of Control)
        Dim controls = sender.Controls.Cast(Of Control)()
        Return controls.SelectMany(
            Function(ctrl) GetAll(ctrl, T)).Concat(controls).Where(
            Function(c) c.GetType() Is T)
    End Function
End Module

A child control on the form
Code:
Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        GroupBox1.GetAll(GetType(TextBox)).ToList.ForEach(
            Sub(c)
                Console.WriteLine("{0}.{1}", c.Parent.Name, c.Name)
            End Sub)
    End Sub
End Class
Test before using
Code:
Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim TextBoxes As List(Of Control) = Panel2.GetAll(GetType(TextBox)).ToList
        If TextBoxes.Any Then
            Console.WriteLine("Got some")
        Else
            Console.WriteLine("None")
        End If
    End Sub
End Class