473,395 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

what is an event?

i used mouseEvents or clickEvents etc.. but i did not still understand what
an event is yet.

eg: when we press a button, the eventhandler registered with the the
button's click *event* is invoked. what is "button's click event" here?
or can we write this event from scratch?

eg: we have an integer , say i. incrementing the i , i++ . could this be an
event too?
i mean, can we invoke a function (or a eventhandler), when i is incremented?
Nov 16 '05 #1
4 1279
e-mid <yy@ss.com> wrote:
i used mouseEvents or clickEvents etc.. but i did not still understand what
an event is yet.

eg: when we press a button, the eventhandler registered with the the
button's click *event* is invoked. what is "button's click event" here?
or can we write this event from scratch?
An event is basically a delegate which is exposed to the outside world
in such a way that other classes can only add delegates to it and
remove them. At some point or other, the class which contains the event
can then fire/raise it by executing the delegates which have subscribed
to it.
eg: we have an integer , say i. incrementing the i , i++ . could this be an
event too?
No.
i mean, can we invoke a function (or a eventhandler), when i is incremented?


No.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
> > i mean, can we invoke a function (or a eventhandler), when i is
incremented?

No. Well you could, if 'i' was a property, and on the set code you can invoke an
event to say it's been modified.

--
John Wood
EMail: first name, dot, second name at priorganize.com
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om... e-mid <yy@ss.com> wrote:
i used mouseEvents or clickEvents etc.. but i did not still understand what an event is yet.

eg: when we press a button, the eventhandler registered with the the
button's click *event* is invoked. what is "button's click event" here? or can we write this event from scratch?
An event is basically a delegate which is exposed to the outside world
in such a way that other classes can only add delegates to it and
remove them. At some point or other, the class which contains the event
can then fire/raise it by executing the delegates which have subscribed
to it.
eg: we have an integer , say i. incrementing the i , i++ . could this be an event too?


No.
i mean, can we invoke a function (or a eventhandler), when i is

incremented?
No.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #3

e-mid,

To put it in layman terms,

event is the place where you get control in your code, based on user's
action.

The common user actions are,

1. moving or clicking mouse
2. playing with keyboard

If you want to do something as soon as the user completed the above
operation, event is the best place to put ur code becoz you can get control
immediately and will know some basic parameters. For example, during
keyboard events, you will get some useful information like, which "key" has
been pressed.

Shak.
"e-mid" <yy@ss.com> wrote in message
news:#g**************@TK2MSFTNGP10.phx.gbl...
i used mouseEvents or clickEvents etc.. but i did not still understand what an event is yet.

eg: when we press a button, the eventhandler registered with the the
button's click *event* is invoked. what is "button's click event" here? or can we write this event from scratch?

eg: we have an integer , say i. incrementing the i , i++ . could this be an event too?
i mean, can we invoke a function (or a eventhandler), when i is incremented?

Nov 16 '05 #4
thnkz all..

"e-mid" <yy@ss.com> wrote in message
news:#g**************@TK2MSFTNGP10.phx.gbl...
i used mouseEvents or clickEvents etc.. but i did not still understand what an event is yet.

eg: when we press a button, the eventhandler registered with the the
button's click *event* is invoked. what is "button's click event" here? or can we write this event from scratch?

eg: we have an integer , say i. incrementing the i , i++ . could this be an event too?
i mean, can we invoke a function (or a eventhandler), when i is incremented?

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: J Sharman | last post by:
What is the easiest way to import an XML Datafeed from a URL into a MYSQL Database? Possibly using PHP Regards Joe PS Please answer to group and joe@joesharman.co.uk
3
by: Brett | last post by:
What is the following code doing? I see evt and event but what is the difference? <input type="radio" id="us_countryFlag1" name="us_country" onclick="togglePurDec(event)">Yes <script>...
3
by: David Logan | last post by:
I have an application using sockets, and it uses the asynchronous method for receiving (and others, but receiving is the basic problem.) In short, I want: class someClass: Form {...
5
by: Action | last post by:
does it works like ordinary virtual method?? coz I find that child class can't invoke the event of the parent class. class parent { public virtual event SomeDelegate SomeChanged; } class...
12
by: Nathan Sokalski | last post by:
What is the difference between the Page_Init and Page_Load events? When I was debugging my code, they both seemed to get triggered on every postback. I am assuming that there is some difference,...
9
by: Jay | last post by:
Everywhere I go (read/browse) I see these parameters.... ByVal sender As Object, ByVal e As System.EventArgs Yet I never see them used within the function/method. Could someone tell me what they...
5
by: kai | last post by:
Hi, In ASP.NET , what is the difference between OnClick and Click events for a button? Because we have button click event, it can trigger events, why we still need OnClick? Please help. ...
7
by: amit | last post by:
Hello everybody, I need your advice on this. In my javascript I'm using two anchor <A> which both are to download a pdf file. That works fine but my question is why the "this" parameter in...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
11
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.