coding for delegates?

Answer Posted / navin c. pandit

Here is the code how to add a delegate:-

Button_Id.OnClick += new EventHandler(function_name());

where function_name() is the name of the method that you
want to call.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you inherit from a sealed class?

654


What do you mean by synchronous and asynchronous operations?

674


What are c# i/o classes?

772


Write a program to find the angle between the hours and minutes in a clock

671


The int maps to which C# keyword in .NET type?

819






Distinguish between continue and break statement?

727


Why do we use struct in c#?

696


Do events have return type c#?

689


What is difference between il and dll ?

706


What is the difference between a private assembly and a shared assembly?

759


Classes and structs can be declared as static, is this statement true or false?

766


how encapsulation is implemented in c#

812


what is a enumeration in c#

747


What are namespaces, and how they are used?

749


Why do we need singleton pattern in c#?

677