Search Forum
(57415 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

Events And Interfaces
By Rajadurai .P

Here is the simple C# code which makes use of the concepts of Events and Interfaces together. This is a simple Windows form which contains a textbox, labels and a button.

The textbox receives the focus on page load. The keydown events of the textbox are captured and whenever any of the arrow keys is pressed, an Event is fired through an Interface which displays the name of the arrow key pressed.

Download events.cs

Here's what it looks like