# Events c#

**URL:** <https://forum.kirupa.com/t/events-c/253366>\
**Category:** programming\
**Created:** [February 29, 2008, 3:16pm UTC](https://forum.kirupa.com/t/events-c/253366 "2008-02-29T15:16:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skjc](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@skjc](https://forum.kirupa.com/u/skjc)\
**Post date:** [February 29, 2008, 3:16pm UTC](https://forum.kirupa.com/t/events-c/253366/1 "2008-02-29T15:16:21Z")

</div>

Hi,

I have the following code:

void buttonClick(object sender, EventArgs e)

{

Button bn = sender as Button;

if (bn.Name == “button1”)

{

MessageBox.Show(“Hey its button one”);

}

}

I am interested in the object sender and eventargs e

From what I understand the object is the object that is raising the event, which is a button in this case. I can use the event as an entry point for several objects (again all buttons) and then I can test to see which button was clicked. I have done this in this code.

A couple of questions:

1. Is there anything else I would commonly use the object for?

2. I am unclear on what if anything I can do with the eventargs or ‘e’

Thank you for any help or pointers with this.
