Search Forum
(53671 Postings)
Search Site/Articles

Archived Articles
712 Articles

C# Books
C# Consultants
What Is C#?
Download Compiler
Code Archive
Archived Articles
Advertise
Contribute
C# Jobs
Beginners Tutorial
C# Contractors
C# Consulting
Links
C# Manual
Contact Us
Legal

GoDiagram for .NET from Northwoods Software www.nwoods.com


 
Printable Version

Event Controls
By Valliyappan Swaminathan

This article will explain how to declare and use the C# Events in your application as Event Control. You can design your event control in couple of minutes, making your Event as control will 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 class public 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.
8) Drag and Drop the New control, using the property window of the control 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