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);
}
}
///...