Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:39:38+00:00 2026-06-03T10:39:38+00:00

I see the following arguments repeated a lot in boilerplate code and yet I

  • 0

I see the following arguments repeated a lot in boilerplate code and yet I don’t seem to have made use of them yet?

(object sender, EventArgs e)

e.g if I double-click on a new button then the event’s method has these arguments and yet when I add code to the method I don’t use the arguments.

What are they and when do I use them?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:39:39+00:00Added an answer on June 3, 2026 at 10:39 am

    The sender is the originator of the event – so you might have several buttons using the same click handler, and you want to disable whichever button was clicked, for example. It’s not terribly useful if you only use an event handler to subscribe to an event for a single source, of course.

    EventArgs itself is pretty pointless, as it has no information – but it’s used as the base class for other classes which do have information (such as keyboard and mouse information). The good thing about having it present at all is that if you don’t need that extra information, you can create a single event handler which can be used to subscribe to any event which follows the pattern. For example:

    button.Click += LogEvent;     // EventHandler delegate type
    textArea.KeyDown += LogEvent; // KeyEventHandler delegate type
    
    ...
    
    private static void LogEvent(object sender, EventArgs ignored)
    {
        Control control = (Control) sender;
        Log("Event fired by " + control.Name);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code fails to compile (using VS2010) and I don't see why. The
Many times I see statements like following Y.CustomApp.superclass.render.apply(this, arguments); I know how apply works.
Is there a way to do the following? I see that the Attribute Arguments
See following code with resides in fillowing directory mypack.pack1 package mypack.pack1; public class myclass
How can I implement cross browser opacity gradient (not color gradient)? See following code:
See the following code of the <?php class DefaultController extends Controller { public function
I have the following code: ProcessStartInfo si = new ProcessStartInfo(./Resources/pdftk.exe, executionstring); Process myproc =
i have following code in c++ #include <iostream> using namespace std; void qsort5(int a[],int
I have following list of arguments that I want to run some application with.
I see code like the following in several books and examples online. The problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.