c#委托调用另一窗口函数
Prerequisite: Delegates in C#
先决条件: C#中的代表
We can also call a member function of a class using delegates. It is similar to static function calls, here we have to pass member function using an object on the creation of delegate.
我们还可以使用委托来调用类的成员函数。 它类似于静态函数调用,这里我们必须在创建委托时使用对象传递成员函数。
Program:
程序:
using System;
using System.Collections;
public delegate void myDelegates();
class Sample
{
public void fun()
{
Console.WriteLine("Call a member function using delegate");
}
}
class Program
{