您的位置:首页 > 其它

winform 利用属性在父、子窗体间传值

2010-11-09 12:14 423 查看
父窗口:
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();
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: