How can I query all Childcontrols of a Winform recursively? [duplicate]
问题 This question already has answers here : How can I get all controls from a Form Including controls in any container? (4 answers) Closed 4 years ago . Iam using windows forms. How can I query all child controls of a Form recursively which have a certain type? In SQL you would use a selfjoin to perform this. var result = from this join this ???? where ctrl is TextBox || ctrl is Checkbox select ctrl; Can I also do this in LINQ? EDIT: LINQ supports joins. Why can't I use some kind of selfjoin?