How to reference a field by reflection
问题 Sorry for the title, it's not explicit. Further to my precedent question, I want to subscribe a method to an event object retrieved dynamically (via reflection). The object in question is a field of a Control : public void SubscribeEvents(Control control) { Type controlType = control.GetType(); FieldInfo[] fields = controlType.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); MethodInfo method = typeof(Trace).GetMethod("WriteTrace"); // "button1" hardcoded for