private void button1_Click(object sender, System.EventArgs e)
{
Form2 f2 = new Form2();
f2.testClick += new test.Form2.OnTestClick(f2_testClick);
f2.ShowDialog();
}
private void f2_testClick(string s)
{
tabPage1.Text = s;
}
}
}
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace test
{
public class Form2 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
public delegate void OnTestClick(string s);
public event OnTestClick testClick;
private System.ComponentModel.Container components = null;