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

  • Home
  • SEARCH
  • 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 58257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:49:11+00:00 2026-05-10T17:49:11+00:00

Have a look at this very simple example WPF program: <Window x:Class=WpfApplication1.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml

  • 0

Have a look at this very simple example WPF program:

<Window x:Class='WpfApplication1.Window1'     xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'     xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'     Title='Window1' Height='300' Width='300'>      <GroupBox>         <GroupBox.Header>             <CheckBox Content='Click Here'/>         </GroupBox.Header>     </GroupBox> </Window> 

So I have a GroupBox whose header is a CheckBox. We’ve all done something like this – typically you bind the content of the GroupBox in such a way that it’s disabled when the CheckBox is unchecked.

However, when I run this application and click on the CheckBox, I’ve found that sometimes my mouse clicks are swallowed and the CheckBox’s status doesn’t change. If I’m right, it’s when I click on the exact row of pixels that the GroupBox’s top border sits on.

Can someone duplicate this? Why would this occur, and is there a way around it?

Edit: Setting the GroupBox’s BorderThickness to 0 solves the problem, but obviously it removes the border, so it doesn’t look like a GroupBox anymore.

  • 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-10T17:49:11+00:00Added an answer on May 10, 2026 at 5:49 pm

    It appears to be a subtle bug in the control template for the GroupBox. I found by editing the default template for the GroupBox and moving the Border named ‘Header’ to the last item in the control templates Grid element, the issue resolves itself.

    The reason is that the one of the other Border elements with a TemplateBinding of BorderBrush was further down in the visual tree and was capturing the mouse click, that’s why setting the BorderBrush to null allowed the CheckBox to correctly receive the mouse click.

    Below is resulting style for the GroupBox. It is nearly identical to the default template for the control, except for the Border element named ‘Header’, which is now the last child of the Grid, rather than the second.

    <BorderGapMaskConverter x:Key='BorderGapMaskConverter'/>  <Style x:Key='GroupBoxStyle1' TargetType='{x:Type GroupBox}'>     <Setter Property='BorderBrush' Value='#D5DFE5'/>     <Setter Property='BorderThickness' Value='1'/>     <Setter Property='Template'>         <Setter.Value>             <ControlTemplate TargetType='{x:Type GroupBox}'>                 <Grid SnapsToDevicePixels='true'>                     <Grid.RowDefinitions>                         <RowDefinition Height='Auto'/>                         <RowDefinition Height='Auto'/>                         <RowDefinition Height='*'/>                         <RowDefinition Height='6'/>                     </Grid.RowDefinitions>                     <Grid.ColumnDefinitions>                         <ColumnDefinition Width='6'/>                         <ColumnDefinition Width='Auto'/>                         <ColumnDefinition Width='*'/>                         <ColumnDefinition Width='6'/>                     </Grid.ColumnDefinitions>                     <Border Grid.Column='0' Grid.ColumnSpan='4' Grid.Row='1' Grid.RowSpan='3' Background='{TemplateBinding Background}' BorderBrush='Transparent' BorderThickness='{TemplateBinding BorderThickness}' CornerRadius='4'/>                     <ContentPresenter Margin='{TemplateBinding Padding}' SnapsToDevicePixels='{TemplateBinding SnapsToDevicePixels}' Grid.Column='1' Grid.ColumnSpan='2' Grid.Row='2'/>                     <Border Grid.ColumnSpan='4' Grid.Row='1' Grid.RowSpan='3' BorderBrush='White' BorderThickness='{TemplateBinding BorderThickness}' CornerRadius='4'>                         <Border.OpacityMask>                             <MultiBinding Converter='{StaticResource BorderGapMaskConverter}' ConverterParameter='7'>                                 <Binding Path='ActualWidth' ElementName='Header'/>                                 <Binding Path='ActualWidth' RelativeSource='{RelativeSource Self}'/>                                 <Binding Path='ActualHeight' RelativeSource='{RelativeSource Self}'/>                             </MultiBinding>                         </Border.OpacityMask>                         <Border BorderBrush='{TemplateBinding BorderBrush}' BorderThickness='{TemplateBinding BorderThickness}' CornerRadius='3'>                             <Border BorderBrush='White' BorderThickness='{TemplateBinding BorderThickness}' CornerRadius='2'/>                         </Border>                     </Border>                     <Border x:Name='Header' Grid.Column='1' Grid.Row='0' Grid.RowSpan='2' Padding='3,1,3,0'>                         <ContentPresenter SnapsToDevicePixels='{TemplateBinding SnapsToDevicePixels}' ContentSource='Header' RecognizesAccessKey='True'/>                     </Border>                 </Grid>             </ControlTemplate>         </Setter.Value>     </Setter> </Style> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 130k
  • Answers 130k
  • 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
  • Editorial Team
    Editorial Team added an answer Nullable types can be used in VB.NET same as in… May 12, 2026 at 6:02 am
  • Editorial Team
    Editorial Team added an answer I think your having the same problem that's been discussed… May 12, 2026 at 6:02 am
  • Editorial Team
    Editorial Team added an answer You will need to do it using the custom Page… May 12, 2026 at 6:02 am

Related Questions

I am currently working on my portfolio website which uses a very simple navigation.
I have a C# class library that contains methods that need to be used
I ran into a scenario where LINQ to SQL acts very strangely. I would
Ok, I'm programming in objective-C and using Xcode. I have read through the documentation

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.