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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:56:29+00:00 2026-05-26T22:56:29+00:00

I have an application with limited screen space, so I’m trying to conserve some

  • 0

I have an application with limited screen space, so I’m trying to conserve some real estate by putting a combo box within a button. Its pretty nifty and it looks exactly like what I wanted it to look like. The problem is, every time I click the down arrow on the combo box, the Button also receives a click event. The drop down menu still works properly, but my button has already fired before I’ve had a chance to actually select what I wanted.

Here is my WPF code that describes my Button and its contents.

<Button FontSize="14" Height="32" HorizontalAlignment="Left" Click="DisableCopierButton_Click">
    <StackPanel Orientation="Horizontal">
        <Label Content="Disable Copier:" />
        <ComboBox Name="DisableCopierComboBox">
            <ComboBoxItem Content="1"/>
            <ComboBoxItem Content="2"/>
        </ComboBox>
    </StackPanel>
</Button>

My question is, when I’m clicking on the ComboBox and only the ComboBox, how do I prevent the click event from passing through the button that is underneath it?

  • 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-26T22:56:30+00:00Added an answer on May 26, 2026 at 10:56 pm

    I finally found it. I went with the solution provided by Rachel here, even though it was not selected as the answer.

    private void EnableCopierButton_Click(object sender, RoutedEventArgs e)
    {
       if (!(e.OriginalSource is Button))
       {
          // combo box was clicked, not the button, so get out of here.
          return;
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have limited screen space for a table that I'm displaying, so I'm showing
We have an application that takes real time data and inserts it into database.
I have an application that defines a real world rectangle on top of an
I have an application that is useable by all users (admin or limited) in
I have an application which will require a dynamic business rules engine. Some of
I have an existing python application (limited deployment) that requires the ability to run
I have an application that runs on a headless linux box (a SheevaPlug, to
I have application which needs to use a dll (also written by me) which
I have application that makes different queries with different results so the caching in
I have Application settings stored under HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany branch. Settings must be same for different

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.