Object Sender and EventArgs in Visual Studio 2005

260 pts.
Tags:
C#
Microsoft Visual Studio
Visual Studio 2005
VS 2005
For Knowledge:-
Private Void Textbox1_TextChange(Object Sender,EventArgs e)
Private is Modifier
Void is Returntype
Textbox1_TextChange is an Event
So what is Object sender,EventArgs e and how does it works?
may be i wrong in above case but it's necessary to understand it better.


Software/Hardware used:
C#, VS-2005

Answer Wiki

Thanks. We'll let you know when a new response is added.

From <a href=”http://msdn.microsoft.com/en-us/library/2ccyd347.aspx”>the documentation</a>:

“When an event does not have any associated data, the class raising the event uses System.EventHandler as the delegate and System.EventArgs for the event data. Events that have associated data use classes that derive from EventArgs …”

The EventArg class is used by events that do not pass additional information to an event handler when an event is raised.

“The sender object indicates what raised the event.”

The ‘sender’ identifies the object that raised the event (the textobox that was modified in this case). This could be useful if you have more than one object using the same event handler.

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Maheshwag
    I accepted ur answer as valuable and most important. thx for Guide me.
    260 pointsBadges:
    report
  • Maheshwag
    One more question for knowledge. the above answer derived from the documentation wright. so the documentation derived from other books. which books?
    260 pointsBadges:
    report
  • Maheshwag
    my apologize : this is from MSDN. Library. Thx.
    260 pointsBadges:
    report
  • Maheshwag
    I don't Know how to accept the answer here. just writing " i am accepted" will do. or any other process let me know please.
    260 pointsBadges:
    report
  • carlosdl
    Hi Maheshwag. If you see a gray check box at the left of the answer wiki you can click on it to approve the provided answer, but I'm not sure if this feature is currently available. If not, we can approve it for you.
    69,920 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following