When I try to call the event myevent in the function fire, it gives compiler error as
delegate mydelegate does not take 0 arguments.
if i try to give arguments in calling myevent as
myevent(this); it again shows error as it does not take 1 parameters. what parameters am i supposed to give in the calling myevent? Here's the program code:
namespace useofdelegates { public class Class1 { int i; public delegate void mydelegate(object sender,EventArgs e); public event mydelegate myevent; public void fire() { myevent(this); // *** shows compiler error *** } } }