Created
January 9, 2014 10:02
-
-
Save tdewilde/8331970 to your computer and use it in GitHub Desktop.
Get all child controls for a certain control.
This file contains hidden or 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
| public static IEnumerable<Control> AllChildControls(this Control control) | |
| { | |
| var children = control.Controls.Cast<Control>(); | |
| return children.SelectMany(c => AllChildControls(c)).Concat(children); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment