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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:20:37+00:00 2026-05-18T00:20:37+00:00

I have a control which extends UserControl . This control contains two ComboBox controls.

  • 0

I have a control which extends UserControl. This control contains two ComboBox controls. I’ve created an event handler which fires when either of the combos changes:


public event EventHandler ComboChanged
{
add { cmbA.SelectedIndexChanged += value; cmbB.SelectedIndexChanged += value; }
remove {...}
}

When I add an event handler to this event, is there any way for the sender to be reported as the custom control (i.e. the ComboBox’s parent control) rather than the ComboBox itself? Or am I trying to do something I shouldn’t be doing here?

  • 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-18T00:20:38+00:00Added an answer on May 18, 2026 at 12:20 am

    You should have something like this :

    public event EventHandler MyControlChanged
    

    and then in your userControl two functions for each of the ComboBox

    protected void oncmbA_SelectedIndexChanged(object sender, EventArgs e)
    {
       if (MyControlChanged!=null)
         MyControlChanged(this, e);//or some new Eventagrs that you wish to communicate
    }
    
    protected void oncmbB_SelectedIndexChanged(object sender, EventArgs e)
    {
       if (MyControlChanged!=null)
         MyControlChanged(this, e);//or some new Eventagrs that you wish to communicate
    }
    

    this would then refer to the UserControl and not to the combobox that fired your UserControl’s event.

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

Sidebar

Related Questions

I have created a class (InputControl) which extends the view of my main class
I have a solution with several projects most of which are code or control
I have a grid in WPF which is made of 4 rows along 2
In one class, I have to call a constructor of another class that needs
Ext.Ajax.request({url:'DeleteAction',success: doneFunction,failure: errorFunction,params:{name:rname}}); The above code is my Ajax request which goes to DeleteAction
i'm dooing this tutorial and at one point he uses the R.id.xxxx where x
Is there a way to get code behind access to databound data each time
I'm using SAX parser in my Android application to read a few feeds a
I'm in a little over my head here with OOP in actionscript. I've got

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.