>>>何通过form2像form1回传参数?set form1's property or method1. pass form1 into form2's constructor:class Form2 : Form
{
Form1 m_form1;
public Form2(Form1 form1) { m_form1 = form1;} //...
m_form1.method()
}2. use a static member in class Form1, when an instance of Form1 is created, set up this value:class Form1 : Form
{
public static Form1 s_form1; public Form1()
{
s_form1 = this;
}
}then in Form2, call Form1.s_form1.Method()
{
Form1 m_form1;
public Form2(Form1 form1) { m_form1 = form1;} //...
m_form1.method()
}2. use a static member in class Form1, when an instance of Form1 is created, set up this value:class Form1 : Form
{
public static Form1 s_form1; public Form1()
{
s_form1 = this;
}
}then in Form2, call Form1.s_form1.Method()
{
//...
}class Form1 : Form, MyInterface
{}class Form2 : Form
{
MyInterface m_mi;
public Form2(MyInterface mi) { m_mi = mi;} //...
m_mi.method()
}