Torna al Thread

Label lbl = new Label(); 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.IsAssignableFrom(typeof(Label))) if ( field.FieldType.IsSubclassOf(typeof(Control))) { if (field.FieldType.IsAssignableFrom(typeof(Label))) { System.Diagnostics.Debug.Print(field.FieldType.Name); PropertyInfo prop = field.FieldType.GetProperty("Text"); if (prop != null) { string valore = (string)prop.GetValue(lbl, null); } } ///...
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5