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

  • Home
  • SEARCH
  • 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 8551503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:12:36+00:00 2026-06-11T14:12:36+00:00

In C# we attach an event handler like this: form1.Click += new EventHandler(form1_Click); What

  • 0

In C# we attach an event handler like this:

form1.Click += new EventHandler(form1_Click);

What is the significance of the “plus” sign? I know we can attach many eventhandlers for a control and hence the += syntax makes sense. But I think I should also be able to write just this:

form1.Click = new EventHandler(form1_Click);

so that i can override all the previous handlers and attach only the last one, but that wouldnt compile. Naturally I think += operator should work as if it is for strings and ints. What is the design principle for forcing += for handlers? In other words why cant i write just = ?

  • 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-11T14:12:37+00:00Added an answer on June 11, 2026 at 2:12 pm

    In this article, please, have a look at Publishing and Subscribing section.

    In C#, any object can publish a set of events to which other classes
    can subscribe. When the publishing class raises an event, all the
    subscribed classes are notified.

    So, you are a subscriber, you are not concerned to influence the list of those, who has already subscribed. It’s in the publishers competence.

    If you say it’s up to a programmer, than you could develop your “publisher”-classes so that they could provide some public method, giving an opportunity to any subscriber to reset some event subscription. In the framework it is prohibited by design. This is also a decision by certain programmers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read that the new delegate method can attach more than one event to
Is there a way to attach an event handler like onclick=alert(Hi); to an existing
When I try to attach event handler functions with parameters like : myhandle.onclick =
I need to attach an event handler to an object, and I placed this
I want to attach a click event handler to each and every (Button, Anchor,
I need to attach to event of the private field of the class like
I can see how to attach an event to an object that has no
I have an easy one SO. Why cant I attach a click event straight
Does jquery/javascript have any event model that you can attach to your objects? Basically
I am using jQuery to attach a function to my click event for an

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.