You can enumerate the MDI children of MDIMain
For each form, test to find out if it's the form you want. Check for form type I guess?
To pass it data, you need a method on the form that will accept data input. You could cast from Form to an Interface that exposes a method
Define Interface
public interface ISendFormData
{
void SendData(object data);
}
Implement interface on Form2
public partial class Form2 : Form, ISendFormData
{
public Form2()
{
InitializeComponent();
}
public void SendData(object data)
{
}
}
foreach Form f in this.MDIChildren
{
Type t = f.GetType();
if (t == typeof(Form2) && t.GetInterface("ISendFormData", true) != null)
{
ISendFormData myForm = (ISendFormData)f;
myForm.SendData("Whatever you like in here!");
break;
}
}