1
Reply

How to instantiate a delegate?

Rangoli

Rangoli

17y
4.1k
0
Reply

    Declare a Delegate as

    public void myDelegate(int iVal);

    public class myClass

    {

     //Constructor

    main()

    {

    myDelegate objDel = new myDelegate(this.DelImplementation);

    objDel(5);

    }

    public void DelImplementation(int val)

    {

    MessageBox.Show("Method parameter value: "+val.ToString());

    }

    }