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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:22:50+00:00 2026-05-25T16:22:50+00:00

I want a checkbox that is invisible in its unchecked state. While unchecked, hovering

  • 0

I want a checkbox that is invisible in its unchecked state. While unchecked, hovering the mouse over it will cause it to animate to 0.3 transparency.

When the mouse pointer leaves the checkbox and if it is still unchecked, it animates back to 0 transparency.

When checked, it will be at fully visible, ie. transparency = 1.

All my attempts so far have been unsuccessful, I think due to the mouse-over rule. When my checkbox becomes checked, the mouse-over still causes a fade to 0.3 and on mouse-leave, it becomes invisible.
I tried using triggers, multitriggers, the VSM, but I can’t figure out how to code the behaviour I want without conflicts.

Code:
Here is the Triggers approach. It’s gone through so many iterations, I can’t even remember if this was my initial approach.
I also have a VSM approach, just say if you want the code for that one too.

Control Template (I took the sample provided in MSDN and just modified it)

    <Style x:Key="{x:Type CheckBox}"
           TargetType="{x:Type CheckBox}">
      <Setter Property="SnapsToDevicePixels"
              Value="true" />
      <Setter Property="OverridesDefaultStyle"
              Value="true" />
      <Setter Property="FocusVisualStyle"
              Value="{DynamicResource CheckBoxFocusVisual}" />
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type CheckBox}">
            <BulletDecorator Background="Transparent">
              <BulletDecorator.Bullet>
                <Border x:Name="Border"
                        Width="80"
                        Height="80"
                        CornerRadius="0"
                        BorderThickness="1">


                  <Grid>
                    <Path Visibility="Visible"
                          Width="100"
                          Height="100"
                          x:Name="CheckBorder"
                          SnapsToDevicePixels="False"
                          StrokeThickness="9"
                          Opacity="0"
      Data="M 0 30 C 2,29 10,30 14,39 M 15,40 C 5,31 55,10 45,20 ">
                      <Path.Stroke>
                        <SolidColorBrush Color="Black" />
                      </Path.Stroke>
                    </Path>                           
                    <Path Visibility="Visible"
                          Width="100"
                          Height="100"
                          x:Name="CheckMark"
                          Opacity="0"
                          SnapsToDevicePixels="False"
                          StrokeThickness="6"
      Data="M 1 30 C 2,29 10,30 14,39 M 15,39 C 5,31 55,10 45,20 ">
                      <Path.Stroke>
                        <SolidColorBrush Color="#FF0C9D0C" />
                      </Path.Stroke>
                    </Path>
                    <Path Visibility="Collapsed"
                          Width="100"
                          Height="100"
                          x:Name="InderminateMark"
                          SnapsToDevicePixels="False"
                          StrokeThickness="5"
                          Data="M 0 0 L 50 50">
                      <Path.Stroke>
                        <SolidColorBrush Color="{DynamicResource GlyphColor}" />
                      </Path.Stroke>
                    </Path>
                  </Grid>
                </Border>
              </BulletDecorator.Bullet>
            </BulletDecorator>

            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckBorder" To="0.3" Duration="0:0:0.1"/>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckMark" To="0.3" Duration="0:0:0.1"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>

                    <Trigger.ExitActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckBorder" To="0" Duration="0:0:0.1"/>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckMark" To="0" Duration="0:0:0.1"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.ExitActions>
                </Trigger>

                <Trigger Property="IsChecked" Value="True">
                    <Setter Property="Opacity" TargetName="CheckBorder" Value="1"/>
                    <Setter Property="Opacity" TargetName="CheckMark" Value="1"/>
                </Trigger>                    



            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>

Declaration

<CheckBox Width="100" Height="100">Hello</CheckBox>
  • 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-25T16:22:51+00:00Added an answer on May 25, 2026 at 4:22 pm

    Well, I just went with a somewhat diabolical workaround. The mouse-over stuff works with a dummy background Path/image, while the check & uncheck work with the main Path/image.

    Kaxaml Code dump:

    <Page
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
      <Grid>  
        <Grid.Resources>
            <Style x:Key="{x:Type CheckBox}"
                   TargetType="{x:Type CheckBox}">
              <Setter Property="SnapsToDevicePixels"
                      Value="true" />
              <Setter Property="OverridesDefaultStyle"
                      Value="true" />
              <Setter Property="FocusVisualStyle"
                      Value="{DynamicResource CheckBoxFocusVisual}" />
              <Setter Property="Template">
                <Setter.Value>
                  <ControlTemplate TargetType="{x:Type CheckBox}">
                    <BulletDecorator Background="Transparent">
                      <BulletDecorator.Bullet>
                        <Border x:Name="Border"
                                Width="80"
                                Height="80"
                                CornerRadius="0"
                                BorderThickness="1">
    
    
                          <Grid>
                          <Path Visibility="Visible"
                                  Width="100"
                                  Height="100"
                                  x:Name="Dummy"
                                  SnapsToDevicePixels="False"
                                  StrokeThickness="9"
                                  Opacity="0"
              Data="M 0 30 C 2,29 10,30 14,39 M 15,40 C 5,31 55,10 45,20 ">
                              <Path.Stroke>
                                <SolidColorBrush Color="#FF224502" />
                              </Path.Stroke>
                            </Path>                                            
                            <Path Visibility="Visible"
                                  Width="100"
                                  Height="100"
                                  x:Name="CheckBorder"
                                  SnapsToDevicePixels="False"
                                  StrokeThickness="9"
                                  Opacity="0"
              Data="M 0 30 C 2,29 10,30 14,39 M 15,40 C 5,31 55,10 45,20 ">
                              <Path.Stroke>
                                <SolidColorBrush Color="Black" />
                              </Path.Stroke>
                            </Path>                           
                            <Path Visibility="Visible"
                                  Width="100"
                                  Height="100"
                                  x:Name="CheckMark"
                                  Opacity="0"
                                  SnapsToDevicePixels="False"
                                  StrokeThickness="6"
              Data="M 1 30 C 2,29 10,30 14,39 M 15,39 C 5,31 55,10 45,20 ">
                              <Path.Stroke>
                                <SolidColorBrush Color="#FF0C9D0C" />
                              </Path.Stroke>
                            </Path>
                            <Path Visibility="Collapsed"
                                  Width="100"
                                  Height="100"
                                  x:Name="InderminateMark"
                                  SnapsToDevicePixels="False"
                                  StrokeThickness="5"
                                  Data="M 0 0 L 50 50">
                              <Path.Stroke>
                                <SolidColorBrush Color="{DynamicResource GlyphColor}" />
                              </Path.Stroke>
                            </Path>
                          </Grid>
                        </Border>
                      </BulletDecorator.Bullet>
                    </BulletDecorator>
    
                    <ControlTemplate.Triggers>
    
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True"/>                        
                                <Condition Property="IsChecked" Value="False"/>
                            </MultiTrigger.Conditions>
    
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Dummy" To="0.3" Duration="0:0:0.1"/>
                                    </Storyboard>
                                </BeginStoryboard>                        
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Dummy" To="0" Duration="0:0:0.1"/>
                                    </Storyboard>
                                </BeginStoryboard>                        
                            </MultiTrigger.ExitActions>                        
    
                        </MultiTrigger>
    
    
    
                         <Trigger Property="IsChecked" Value="True"> 
                            <Setter TargetName="CheckBorder" Property="Opacity" Value="1"/>
                            <Setter TargetName="CheckMark" Property="Opacity" Value="1"/>
                         </Trigger>
    
    
    
                         <Trigger Property="IsChecked" Value="False"> 
                            <Setter TargetName="CheckBorder" Property="Opacity" Value="0"/>
                            <Setter TargetName="CheckMark" Property="Opacity" Value="0"/>
                         </Trigger>                    
    
    
                    </ControlTemplate.Triggers>
                  </ControlTemplate>
                </Setter.Value>
              </Setter>
            </Style>
    
    
    
        </Grid.Resources>
    
    
            <CheckBox Width="100" Height="100">Hello</CheckBox>
      </Grid>
    </Page>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want my website to have a checkbox that users can click so that
I want to unhide the hidden divCommentBody div that belongs to the checked checkbox,
I have used checkbox column in gridview. I want to check status of that
I want to have a hidden checkbox that doesn't take up any space on
I have a checkbox that I want to bind to a subclass. The DataSource
Please help. I want to add a click event on checkbox that i created
I have a checkbox that when gets clicked will open up a dialog. If
Basically I want a list view(CheckBox and TextView) that has all the data from
I have a checkbox that I want to perform some Ajax action on the
I have a JSF page on which I want to have a checkbox that,

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.