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 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
  • 1 View
  • 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

Related Questions

I have this very simple wrapper template: template<class T> struct wrapper { inline operator
I have a simple (very simple:) ) client and server which can send text
I am trying to do a very simple web crawler/spider app in C++. I
I am an experienced coder who is trying to learn C# and WPF. Now,
I have a HTML document that I want to remove specific tags from, identified
I'm still very new to ShiVa3d and fairly new to iOS. I'd like to
I have a huge list of video files from a webcam that have that
I have been working on an Android game for the past 6 months or
I want to write some functions as follows y = f(x) and another function,
I'm looking for applications and programming language constructs to search for a regular expression

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.