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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:00:09+00:00 2026-05-10T16:00:09+00:00

Image a Button on your windows form that does something when being clicked. The

  • 0

Image a Button on your windows form that does something when being clicked.

The click events thats raised is typically bound to a method such as

protected void Button1_Click(object sender, EventArgs e) {

}

What I see sometimes in other peoples’ code is that the implementation of the buttons’ behaviour is not put into the Button1_Click method but into an own method that is called from here like so:

private DoStuff() { }

protected void Button1_Click(object sender, EventArgs e) { this.DoStuff(); }

Although I see the advantage here (for instance if this piece of code is needed internally somewhere else, it can be easily used), I am wondering, if this is a general good design decision?

So the question is: Is it a generally good idea to put event handling code into an own method and if so what naming convention for those methods are proven to be best practice?

  • 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. 2026-05-10T16:00:09+00:00Added an answer on May 10, 2026 at 4:00 pm

    I put the event handling code into a separate method if:

    • The code is to be called by multiple events or from anywhere else or
    • The code does not actually have to do with the GUI and is more like back-end work.

    Everything small and only GUI-related goes always into the handler, sometimes even if it is being called from the same event (as long as the signature is the same). So it’s more like, use a separate method if it is a general action, and don’t if the method is closely related to the actual event.

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

Sidebar

Ask A Question

Stats

  • Questions 67k
  • Answers 67k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Why do you need the original text? Is it to… May 11, 2026 at 11:46 am
  • added an answer ToggleButtonBar does this for you May 11, 2026 at 11:46 am
  • added an answer There isn't a threshold where a small database becomes medium… May 11, 2026 at 11:46 am

Related Questions

Image a Button on your windows form that does something when being clicked. The
I have a image button. I wanted to add a text Search on it.
I have a lot of buttons and by clicking on different button, different image
If I have a button like the one in this image : http://www.freeimagehosting.net/image.php?4cd775814c.png how
I have a CALayer with some image contents. When a button touched, I want
I'm writing an image bank with Django, and I want to add a button
How can I create in a Swing interface a toggle image button? I have
I have an image(a map) with some points of interest placed using position: absolute
I have a gradient image as a background for a table header(9x18pix). This image
I have a JPEG image (actually a BLOB in a database) which I want

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.