递归容器中所有控件

    Sub FindControl(ByVal Ctrls As Control)

        For Each C As Control In Ctrls.Controls

            MessageBox.Show(C.Name)

            If C.HasChildren Then

                FindControl(C)

            End If

        Next

    End Sub

你可能感兴趣的:(c,each)