来一小段代码:namespace Server
{
public partial class one1 : Form
{
public one1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
two2 t2 = new two2();
t2.bevent += new two2.billhadll(setvalue);
if (t2.ShowDialog() == DialogResult.OK)
{
}
}
private void setvalue()
{
this.label1.Text = "结账成功!";
}
}
}namespace Server
{
public partial class two2 : Form
{
public delegate void billhadll();
public event billhadll bevent;
public two2()
{
InitializeComponent();
} public void button1_Click(object sender, EventArgs e)
{
if (bevent != null)
{
bevent();
}
}
}
}
{
public partial class one1 : Form
{
public one1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
two2 t2 = new two2();
t2.bevent += new two2.billhadll(setvalue);
if (t2.ShowDialog() == DialogResult.OK)
{
}
}
private void setvalue()
{
this.label1.Text = "结账成功!";
}
}
}namespace Server
{
public partial class two2 : Form
{
public delegate void billhadll();
public event billhadll bevent;
public two2()
{
InitializeComponent();
} public void button1_Click(object sender, EventArgs e)
{
if (bevent != null)
{
bevent();
}
}
}
}
解决方案 »
- 怎样为PropertyGrid控件,添加下拉列表
- 导出openoffice2.1的问题
- winform下面datagridview的下拉菜单加载问题。
- c#中二叉树问题(在线等)
- 关于line
- uint 类型的数值计算补码怎么计算的?可有现有的类?
- vs2003————7cd中文版
- xml的小问题~~~~~~~~~~帮忙帮忙
- 关于DATALIST传值问题 100分,在线等
- 思归和各位高手快看啊---组合键的问题Keys.Shift + Keys.Down
- 小弟最近用C#做一个WORD文档,先文字,后图片,再表格,但是图片无法显示,求救!!!
- 读取日志工具,计算时间方法第二次没有进方法体,直接默认值了,请高手帮忙解决,不甚感激!!!
给你个链接http://www.cnblogs.com/JimmyZhang/archive/2007/09/23/903360.html