父窗口:
public partial class wc_DanChen : Form
{
public int userID;
public wc_DanChen()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
wc_NewYard NewForm = new wc_NewYard(this);
NewForm.show();
}
}
子窗口
public partial class wc_NewRoll : Form
{
private wc_NewYard frmParent;
public wc_NewRoll(wc_NewYard parent)
{
InitializeComponent();
frmParent = parent;
}
private void button3_Click(object sender, EventArgs e)
{
frmParent.userID = " ";
this.close();
}
}
public partial class wc_DanChen : Form
{
public int userID;
public wc_DanChen()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
wc_NewYard NewForm = new wc_NewYard(this);
NewForm.show();
}
}
子窗口
public partial class wc_NewRoll : Form
{
private wc_NewYard frmParent;
public wc_NewRoll(wc_NewYard parent)
{
InitializeComponent();
frmParent = parent;
}
private void button3_Click(object sender, EventArgs e)
{
frmParent.userID = " ";
this.close();
}
}