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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:28:32+00:00 2026-05-15T07:28:32+00:00

For event handling, I am starting to see many coders doing this: XButton.Click +=

  • 0

For event handling, I am starting to see many coders doing this:

XButton.Click += OnXButtonClicked()
...
void OnXButtonClicked()
{ ... }

Where did this On_ convention come from? It just doesn’t feel right in terms of methods.

I am starting to see this as well and am wondering what others thought:

XButton.Click += HandleXButtonClick()
...
void HandleXButtonClick()
{ ... }

When using intellisense, Visual Studio handles these like so:

XButton.Click += XButton_Click;
...
void XButton_Click(object sender, RoutedEventArgs e)
{ ... }

I am seeking some advice on these naming conventions and would greatly appreciate some advice.

  • 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-05-15T07:28:33+00:00Added an answer on May 15, 2026 at 7:28 am

    As these are typically always private methods, the name is really entirely up to you and your team. The event handlers are only used within your private API, and are an implementation detail, which is partly why there isn’t any official guidance in terms of naming.

    That being said, I would just choose something that makes sense to you and your team, and stick to it for consistency.

    Personally, I don’t like the “OnXXX” name, as it is somewhat misleading. The suggestion for implementation of events is to use OnXXX as a protected method which raise the event XXX. Using this name as an event handler seems inappropriate.

    A HandleXXX name makes sense, given that this is an event subscription, and that method is “handling” the event. The Object_XXX syntax has the advantage of being what the designer in Visual Studio uses by default, so it is also a good choice. That being said, it often conflicts with private variable and method naming schemes (since they’re typically lower case) and will make tools like StyleCop complain.

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

Sidebar

Related Questions

Javascript jQuery event handling If on event (for example 'click') bound one function for
This question bugs me. How event handling systems works? what i understand is that
I'm getting into event handling now, and it seems quite confusing to me. See,
Here is my surface-changed event handling code: public void surfaceChanged(SurfaceHolder holder, int format, int
I am very confused with the Event Handling in Blackberry. I facing many problems
I am facing problem during event handling. The problem is like this: My GUI
This question is related to Javascript event handling and flow control , but it
How can i achieve event handling for dynamic controls in VB6? Any ideas?
I've been working with some event handling in Javascript and recently decided to migrate
I am trying to understand the Javascript event handling. I like some code to

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.