我想这一点:公共自定义事件在用户控件
public partial class ucTest : UserControl
{
...
SomeEvent { MessageBox.Show("Inner Call") }
}
public partial class frmTest: Form
{
...
SomeEvent += OuterEventInstance;
...
void OuterEventInstance(object sender, EventArgs e)
{ MessageBox.Show("Inner Call") }
...
}
我如何可以在包含该用户控件的实例的形式是可用的(和可扩展)用户控件定义的公共事件?
你是什么意思的 “扩张”? – 2013-02-21 09:06:48
我的意思是这个'SomeEvent + = OuterEventInstance;'这样我就可以在用户控件中的按钮被点击时运行一些代码。 – 2013-02-21 09:11:19
你需要解释更多关于你的问题。我认为你的答案是[我对你的其他问题的回答](http://stackoverflow.com/a/14956801/1174942)。您的用户控件的“MyClikc”事件可以像其他事件一样以其容器形式访问。 – 2013-02-21 09:14:10