R
Ron
I have a situation where I have an object name as a string, and a method as
a string. I need to construct a click handler with those two bits of
information. This is what I came up with so far... and the error message I
am receiving...
Assembly assem = Assembly.GetExecutingAssembly();
string currentNamespace =
Assembly.GetExecutingAssembly().GetTypes()[0].Namespace;
Type type = assem.GetType(currentNamespace + "." + m_FormName, true, true);
MethodInfo methinf = type.GetMethod(MethodCall);
m_ButtonControl.Click += new CommandEventHandler(methinf);
Error 1 'methinf' is a 'variable' but is used like a 'method'
Thanks,
Ron
a string. I need to construct a click handler with those two bits of
information. This is what I came up with so far... and the error message I
am receiving...
Assembly assem = Assembly.GetExecutingAssembly();
string currentNamespace =
Assembly.GetExecutingAssembly().GetTypes()[0].Namespace;
Type type = assem.GetType(currentNamespace + "." + m_FormName, true, true);
MethodInfo methinf = type.GetMethod(MethodCall);
m_ButtonControl.Click += new CommandEventHandler(methinf);
Error 1 'methinf' is a 'variable' but is used like a 'method'
Thanks,
Ron