110,536
社区成员
发帖
与我相关
我的任务
分享
public class a
{
b b1 = new b();
public static void a1()
{
MessageBox.Show("a1");
}
//如何将A1函数传递给B类中,并且在B类中执行A1这个函数
}
public class b
{
public static void Test()
{
//这里直接调用
a.a1();
}
}
2:使用委托
public class a
{
b b1 = new b();
public void a1()
{
MessageBox.Show("a1");
}
//如何将A1函数传递给B类中,并且在B类中执行A1这个函数
}
public class b
{
public void TestOther()
{
Action action = new a().a1;
action();
}
}