From 4058a492ee2dcd7919729812a6a07b9c3a963a1d Mon Sep 17 00:00:00 2001 From: lhiven Date: Fri, 29 Nov 2024 08:18:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=A5=E6=89=BE=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E5=86=85=E9=83=A8=E6=89=80=E6=9C=89=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.Framework/ControlManager.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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查找控件数组 ///