diff --git a/Rs.Framework/ControlManager.cs b/Rs.Framework/ControlManager.cs index 19abec1..9f69268 100644 --- a/Rs.Framework/ControlManager.cs +++ b/Rs.Framework/ControlManager.cs @@ -14,6 +14,28 @@ namespace Rs.Framework { public static class ControlManager { + public static List GetControlList(Control findControl) + { + List list = GetContolsInternal(findControl, new List()); + return list; + } + + private static List GetContolsInternal(Control findControl,List foundControls) + { + if(findControl!=null && findControl.Controls.Count>0) + { + foreach (Control subControl in findControl.Controls) + { + foundControls.Add(subControl); + if(subControl.Controls.Count > 0) + { + foundControls= GetContolsInternal(subControl, foundControls); + } + } + } + return foundControls; + } + /// /// 通过控件Tag查找控件数组 ///