【发布时间】:2012-12-13 09:33:37
【问题描述】:
我有
class A
{
B b;
//call this Method when b.Button_click or b.someMethod is launched
private void MyMethod()
{
}
??
}
Class B
{
//here i.e. a button is pressed and in Class A
//i want to call also MyMethod() in Class A after the button is pressed
private void Button_Click(object o, EventArgs s)
{
SomeMethod();
}
public void SomeMethod()
{
}
??
}
A 类有一个 B 类的实例。
如何做到这一点?
【问题讨论】:
标签: c# events event-handling