I'm trying to invoke a method that returns a value (actually a Panel), but i
keep getting an error:
System.Reflection.TargetException was unhandled
Message="Object does not match target type."
Here's the code:
MethodInfo methodInfo = typeChannelPanel.GetMethod("CreateNavPanel");
Panel o_Panel = (Panel)methodInfo.Invoke(methodInfo, null);
I've tried creating it as an Object and i get the same error. The
CreateNavPanel returns a Panel, which i then need to add to the main form.
What am i missing here?