Quantcast
Viewing all articles
Browse latest Browse all 10

C# Event Controls

This article will explain how to declare anduse the C# Events in your application as Event Control. You can designyour event control in couple of minutes, making your Event as controlwill be easy for GUI developer to implement Events in Client side.

Here are the steps:
1) Create one windows application Project
2) Add "Component Class" using Add new Item this is going to be your Event control.
3) Declare your delegate in your Event control Under your name space public delegate void SampleDelegate(string Str);
4) Now Declare your Event in side your Event Control classpublic event SampleDelegate Sample;
5) Also add the FireTheEvent method to fire The event.
6) Build the Project.
7) Go to Form then ToolBox add the EventControl usin g Menu by Right clicking on the tool box.
Image may be NSFW.
Clik here to view.
8)
Drag and Drop the New control, using the property window of thecontrol u can easily implement the Event method in your Application.
9) Call The fireTheEvent method in your button click by adding new button to your form.
10) Run the application and Click on your Button , u should see your Event Firing.

Download Source


Viewing all articles
Browse latest Browse all 10

Trending Articles