-3
我一直试图让这个工作。我敢肯定,我已经写在correctely如何从其他表单传递数据并返回
表1
private string _temp;
public string Temp
{
get { return _temp; }
set { _temp = value; }
}
private void button1_Click(object sender, EventArgs e)
{
_temp = "test";
}
表2
private void button1_Click(object sender, EventArgs e)
{
Form1 main = new Form1();
MessageBox.Show(main.Temp);
}
什么问题?您尚未描述此代码的任何问题。 – ryanyuyu
我试图从窗体1中获取Temp的值到窗体2 –
[两窗体窗体之间的通信]的可能重复(http://stackoverflow.com/questions/1665533/) –