Hello, I made an mdi program and I load dinamically some child form this way:
Assembly newDll = Assembly.LoadFile("Child_01.exe");
Type type = newDll.GetType("Child.Form1");
Object obj = Activator.CreateInstance(type);
Form child = (Form)Activator.CreateInstance(type);
child.MdiParent = this;
child.WindowState = FormWindowState.Maximized;
child.Show();
In the child forms I would like to send event (for example pushing a button etc)
to the Parent Form.
I tried using an interface but I still can't make the Parent Form to get the rising of the event.
here's the interface example:
namespace EventManager
{
public interface IEventInterface
{
event EventHandler<testargs style="color:#111111;font-family:'Segoe UI', Arial, sans-serif;font-size:14px;line-height:normal;"> TestChanged;
void RaiseEvent(String value);
}
public class TestChangeArgs : EventArgs
{
public TestChangeArgs(String value)
{
ChangeText = value;
}
public String ChangeText { get; private set; }
}
}</testargs>
<testargs style="color:#111111;font-family:'Segoe UI', Arial, sans-serif;font-size:14px;line-height:normal;"></testargs>
<testargs style="color:#111111;font-family:'Segoe UI', Arial, sans-serif;font-size:14px;line-height:normal;">Thanks in advance</testargs>