Created
July 25, 2014 19:40
-
-
Save anova/c9b8d4b3ee7af9a8a8a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' <summary> | |
''' Finds a Control recursively. Note finds the first match and exists | |
''' </summary> | |
''' <param name="ContainerCtl"></param> | |
''' <param name="IdToFind"></param> | |
''' <returns></returns> | |
Public Shared Function FindControlRecursive(Root As Control, Id As String) As Control | |
If Root.ID = Id Then | |
Return Root | |
End If | |
For Each Ctl As Control In Root.Controls | |
Dim FoundCtl As Control = FindControlRecursive(Ctl, Id) | |
If FoundCtl IsNot Nothing Then | |
Return FoundCtl | |
End If | |
Next | |
Return Nothing | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment