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 8651923
In Process

The Archive Base Latest Questions

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

What is the difference between: this.btnConnect.Click += btnConnect_Click; and: this.btnConnect.Click += new RoutedEventHandler(btnConnect_Click); It

  • 0

What is the difference between:

this.btnConnect.Click += btnConnect_Click;

and:

this.btnConnect.Click += new RoutedEventHandler(btnConnect_Click);

It seems to work the same either way, but Visual Studio IntelliSense inserts the second example and I’m curious why.

My initial guess is that using the IntelliSense version makes it so that each button calls its own instance of the RoutedEventHandler, making it thread-safe?
And that using the first example, then each button would call the same instance of that method and they might step on each others feet.

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

    It is the same thing, the first is just a syntactic sugar, i.e. compiler generates the same IL bytecode for both – there is always a delegate instance created.

    IIRC, the first version of C# didn’t allow the first syntax, it was introduced in C# 2.0.

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

Sidebar

Related Questions

What's the difference between this two: _btnAddNew.Click += OnAddNewClick; _btnAddNew.Click += new RoutedEventHandler(OnAddNewClick); Thank
What is the difference between this: this.btnOk.Click += new System.EventHandler(this.btnOK_Click); and this? this.btnOk.Click +=
I was wondering about performance difference between : this.BTN_LogIN.Click += new EventHandler(BTN_LogIN_Click); vs <asp:Button
What is the difference between this.Loaded += new RoutedEventHandler(MainWindow_Loaded); and childWindow.MyEvent += new EventHandler(childWindow_MyEvent);
Is there any essential difference between this code: ThreadStart starter = new ThreadStart(SomeMethod); starter.Invoke();
I just noticed a new term pimpl idiom, what's the difference between this idiom
Is there any difference between doing this: $(.topHorzNavLink).click(function() { var theHoverContainer = $(#hoverContainer); var
What is the difference between this: Myclass *object = new Myclass(); and Myclass object
I understand what this does, but what is the difference between *this and this
What difference between this methods, why SortDropDown is correct but Page_load and GetCases are

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.