![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
public partial class Form1 : Form
{
private void GetReturnValue(string text)
{
textBox1.Text=text;
}
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 frm=new Form2(textBox1.Text);
frm.ReturnValue=GetReturnValue;
frm.Show();
}
}
public partial class Form2 : Form
{
public delegate void returnValue(string text);
public returnValue ReturnValue;
public Form2()
{
InitializeComponent();
}
public Form2(string text)
: this()
{
textBox1.Text=text;
}
private void button1_Click(object sender, EventArgs e)
{
if (ReturnValue != null)
{
ReturnValue(textBox1.Text);
}
Close();
}
}
2009年6月23日
posted @
2009-06-23 15:03
好俊的功夫啊
阅读(
318)
评论()
编辑
收藏
举报