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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:12:21+00:00 2026-06-03T15:12:21+00:00

Hi all, I am working on creating a button template to use in my

  • 0

Hi all,

I am working on creating a button template to use in my WPF application. The format is basically color tiles (Think Windows Phone style for the most part.).

If I was wanting to change the color of the button in the event of a MouseOver, I would just make some code like this (let’s say the original button color is Gray):

<Window.Resources>
    <Style x:Key="ColorTileButton" TargetType="Button>

<!-- Insert various property editing here. -->

        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="LightGray" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="False>
                <Setter Property="Background" Value="Gray" />
            </Trigger>
        </ControlTemplate.Triggers>
    </Style>
</Window.Resources>

But obviously this wouldn’t work if the original button color was, say, Firebrick because I would end up with a bunch of standard Gray buttons. So I was wondering if there would be a way to rewrite this button template so that it would just increment the values of R, G, and B by about 10 to give the button a lighter color, then decrement is when the mouse left. Help me out?

Thanks guys.

  • 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-03T15:12:23+00:00Added an answer on June 3, 2026 at 3:12 pm

    I believe what you are describing is ColorAnimation an example, or you can look at this Forum Post. An interesting note from the Forum post.

    A trigger makes a change to one or more properties when its condition is satisfied, and then resets the property values when its condition is no longer satisfied.

    So what he is suggesting is:

    <ControlTemplate.Triggers> 
        <Trigger Property="IsMouseOver" Value="True"> 
            <Setter Property="Background" Value="LightGray" /> 
        </Trigger> 
    </ControlTemplate.Triggers> 
    

    it would reset to FireBrick as you gave in your example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on creating a Windows Forms Application in C++ using Visual Studio
I am working on creating a model where I want all of the decimal
My wordpress*(a custom template)* nav is all working on all of the pages but
I'm creating a Flash Application that will be exported in exe format and it's
I'm creating a basic database application in WPF, and I have started using the
I'm working on a multi-user phonebank software. I originally was planning to use Windows
Currently I am working on an Android application that is dynamically creating controls. Everytime
I'm creating a WPF application using the MVVM design pattern, and I'm trying to
i am creating a button using Jquery in myPage.jsp. it is working fine in
I'm creating a CSS button and it is working ALMOST perfectly. The problem is

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.