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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:34:49+00:00 2026-06-04T18:34:49+00:00

On mouse is up button should show the background border I have created a

  • 0

On mouse is up button should show the background border

I have created a simple style

<UserControl.Resources>
        <Style TargetType="Button" x:Key="TransparentButton">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="Transparent">
                            <ContentPresenter/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

and in button

<Button  Height="20" Width="20"  Padding="0,0,0,0" DockPanel.Dock="Top" Grid.Row="0" Grid.Column="1" Click="button_click"  Style="{StaticResource TransparentButton}"
                    BorderBrush="Transparent" BorderThickness="0" Background="Transparent">
            <Button.Content>
                <Image Source="../Resources/Help_icon.png" Stretch="UniformToFill" />
            </Button.Content>
            </Button>

But in this case when button is pressed it doesn’t show up in UI. User should feel that button is pressed.

Thanks and regards

  • 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-06-04T18:34:50+00:00Added an answer on June 4, 2026 at 6:34 pm

    I’m not sure what you want visually, but if you want the border to change color when the button is pressed down, you would modify your template like this:

    <Style TargetType="Button" x:Key="TransparentButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border Name="border" Background="Transparent" BorderThickness="1" BorderBrush="Black">
                        <ContentPresenter/>
                    </Border>
    
                    <ControlTemplate.Triggers>
                        <Trigger Property="Button.IsPressed" Value="True">
                            <Setter TargetName="border" Property="BorderBrush" Value="Transparent" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </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 a NSTrackingArea to determine whether I should show a close button in
I have a class called Mouse (tracking button states in a game). I want
I have the following xaml for changing the image for WPF button when mouse
Struggling with styling the mouse over for a button ... I have managed to
I have a submit button that changes when the user hovers his mouse over
I have a jQuery UI Button that I am trying to style using CSS.
In WPF most controls have MouseUp and MouseDown events (and the mouse-button-specific variations) but
I have a button class where i have used mouse press and release event.
This works for the key-presses but not for mouse-clicks. What should I change here
I want if user moved the mouse for two seconds (Keep the mouse button

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.