不知道你要的是什么效果,给个简单的示例:
public event EventHandler TextChange;
public EventTest()
{
TextChange = Test;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (TextChange != null)
{
TextChange(sender, e);
}
}
public void Test(object sender, EventArgs e)
{
MessageBox.Show("TextChanged");
}
支持楼上的解决方案!