Click here to Skip to main content
16,004,653 members
Articles / Programming Languages / C#

Find a Parent Control Recursively

Rate me:
Please Sign up or sign in to vote.
4.67/5 (2 votes)
24 Sep 2010CPOL 19.5K   5  
Useful function, but I don't see any need for an recursion here. I'd solve it like this:private static Control FindControlParent(Control control, Type type) { Control ctrlParent = control; while((ctrlParent = ctrlParent.Parent) != null) { ...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Austria Austria
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions