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();
}
}
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();
}
}
相关文章推荐
- [转]winForm:利用窗体的自定义属性实现窗体传值
- [转]winForm:利用窗体的自定义属性实现窗体传值
- Winform利用委托实现子窗体传值给父窗体
- 利用泛型对winform传值,并且只能打开一个同样的窗体
- Winform窗体传值的几种方式(属性赋值,委托,事件)
- winform窗体间传值(使用Tag属性)
- 利用窗体的自定义属性实现窗体传值
- C# Winform 窗体传值 利用委托 子窗体传值给父窗体
- winform 利用委托实现窗体传值
- C# Winform 窗体传值 利用委托 子窗体传值给父窗体
- winform利用委托实现窗体间传值
- C#开发 WinForm中窗体显示和窗体传值相关知识
- C#之winform基础 ,form1显示form2中textbox中输入的文本,窗体间传值
- 【WinForm窗体控件开发】之三续 窗体控件设计时的事件属性
- WinForm窗体间传值
- c# WinForm 窗体之间传值的几种方式(小结)
- Winform 窗体间传值的10种方法
- winform程序三个窗体间同步数据(六):利用多播委托同步数据
- winform窗体传值小结
- Winform中的窗体一些常用属性