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.GetExe cutingAssembly( );
string currentNamespac e =
Assembly.GetExe cutingAssembly( ).GetTypes()[0].Namespace;
Type type = assem.GetType(c urrentNamespace + "." + m_FormName, true, true);
MethodInfo methinf = type.GetMethod( MethodCall);
m_ButtonControl .Click += new CommandEventHan dler(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.GetExe cutingAssembly( );
string currentNamespac e =
Assembly.GetExe cutingAssembly( ).GetTypes()[0].Namespace;
Type type = assem.GetType(c urrentNamespace + "." + m_FormName, true, true);
MethodInfo methinf = type.GetMethod( MethodCall);
m_ButtonControl .Click += new CommandEventHan dler(methinf);
Error 1 'methinf' is a 'variable' but is used like a 'method'
Thanks,
Ron
Comment