Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Events in C# language

This is a discussion on Events in C# language within the C# forums, part of the Software Development category; Question asked by Visitor Mansoor Can someone explain me events in c# language? any example will help....

Go Back   Geeks Talk > Software Development > C#
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 04-03-2007
Expert Member
 
Join Date: Feb 2007
Posts: 1,279
Thanks: 0
Thanked 192 Times in 154 Posts
Geek_Guest has a spectacular aura aboutGeek_Guest has a spectacular aura aboutGeek_Guest has a spectacular aura about
Events in C# language

Question asked by Visitor Mansoor

Can someone explain me events in c# language? any example will help.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-09-2007
Junior Member
 
Join Date: Apr 2007
Location: New Delhi
Posts: 9
Thanks: 1
Thanked 2 Times in 2 Posts
bhaskarjha is on a distinguished road
Re: Events in C# language

First I would like u to understand what the event is?
Event in simple meaning is any interaction of a user to the system that causes the system to take actions is event. E.g. when you (a user) click a link (interaction) in this page you initiate an ineraction with this page. Now this ineraction (event) would cause the system to take actions. The event is like waking call to the system. A notification message to the system that says that any thing happened.

the whole processing model is based on this
user<-->Ineraction<-->System<-->Execute Event Code
this is called event driven model.

In C# or VB the event is managed by the delegates that take any event method as an argument and execute proper method whenever user interact with the system. You define event code for any contol or page in seperate method like Page_Load for page loading event or button1_Click method for button..
e.g
protected void button_Click(object sender, EventArgs e)
{
//Your implementaion
}

you register this event as:
button1.OnClik+=new EventHandler(button_Click); //Delegate

But behind the scenes windows OS model manages these events through window messages running on different threads. So you can say the event model in C# is higher level of abstraction of this window messaging.
For further reading please refer to any C# books or MSDN Online.

Last edited by bhaskarjha; 04-09-2007 at 12:48 PM.
Reply With Quote
  #3 (permalink)  
Old 04-11-2007
Junior Member
 
Join Date: Jan 2007
Location: Bangalore
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
harshakj is on a distinguished road
Re: Events in C# language

In google search for 'function X ' you'll get a good article on Events and exception handling and many more. It's very good set of articles for beginner
Reply With Quote
Reply

  Geeks Talk > Software Development > C#

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
GOOGLE's programming language ITGuy Geeks Lounge 4 09-14-2009 09:57 AM
GD-001 Among all the OOPS Language, which one is the best? Why it is the best? admin Group Discussions 19 12-14-2007 02:34 AM
Watching XP system events! Lokesh M Windows 1 01-10-2007 06:41 PM
Language problem joel Interviews 3 01-06-2007 01:50 AM
C Language - The Preprocessor Lokesh M C and C++ 1 06-17-2006 07:41 AM


All times are GMT -4. The time now is 02:26 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved