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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:53:40+00:00 2026-05-30T19:53:40+00:00

Say I added a series buttons to a WPF app progammatically, as part of

  • 0

Say I added a series buttons to a WPF app progammatically, as part of a label, textbox, button section, and attached a single handler to the click event of all of these. How can I specify which button (pertaining to which section) is being clicked, so it can be handled accordingly?

Attaching individuals handlers won’t work since the user must be able to add as many of these ‘lines’ as needed.

A possible alternative would be to pass information to the event handler, such as:

    ...
    var sender = this;
    var args = new CustomEventArgs(sectionName);

    var button = new Button();
    button.Click += Button_EventHandler_Click(sender, args);

But I haven’t found a way to this in C#.

Any help/idea will be appreciated!

Thanks

  • 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-30T19:53:41+00:00Added an answer on May 30, 2026 at 7:53 pm

    Look at the sender parameter, it will be the clicked button.

    If you need to further differenciate the buttons, you can set the Tag property of the button.

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

Sidebar

Related Questions

Let's say I have a webpage and I have added the 1+ button. Is
So lets say I've added some prototype methods to the Array class: Array.prototype.containsKey =
It is very easy to count all rows added lets say in june 2011,
can you get the last or newly added element in std::set? for example say
let's say you added a controller and action (example: story/index ), and want to
Title pretty much covers it. If I've added say 3 objects to a list
I have added some constants to a model say MyModel.rb as shown below. MY_CONST
I have 5 CALayers each one is a property. Say I added 3 of
In android, a fragment (say FragA ) gets added to the backstack and another
Say I have created a linearlayout ( linLayBtn ) and added it to 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.