Torna al Thread

try { Control ctl = new Control(); foreach (Type t in yourAssembly.GetTypes()) { if (t.IsSubclassOf(typeof(Form))) { TreeNode addedForm = treeView1.Nodes.Add(t.Name); foreach (FieldInfo field in t.GetFields(BindingFlags.Public|BindingFlags.NonPublic| BindingFlags.Instance)) { if (field.FieldType.IsSubclassOf(typeof(Control))) { PropertyInfo prop = field.FieldType.GetProperty("Text"); if (prop!=null) { prop.GetValue(ctl, null); ***** } addedForm.Nodes.Add(field.Name + " " + ctl.Text ); } } } } } catch (Exception ex2) { MessageBox.Show(ex2.StackTrace); } }
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5