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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:12:37+00:00 2026-05-25T14:12:37+00:00

Is there a way to animate a TextBlock ‘s colour change? At the moment

  • 0

Is there a way to animate a TextBlock‘s colour change?

At the moment I am basically using the enter/leave events to change the colour and I would like to a almost like a fade (but a fast fade, so .1/.2 secs) to give it a nicer visual appearance instead of being instantaneous.

Any advice on the best/easiest way to do this?

ps. Due to constraints, the actual code is vb.net but I will accept c#.net answers as I can read both fine. Just learning WPF.

ta

  • 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-25T14:12:37+00:00Added an answer on May 25, 2026 at 2:12 pm

    You want a ColorAnimation. There’s an example on that page either in XAML:

    <!-- Animates the brush's color to orange
         when the mouse leaves the rectangle. -->
    <EventTrigger RoutedEvent="Rectangle.MouseLeave">
      <BeginStoryboard>
        <Storyboard>
          <ColorAnimation
            Storyboard.TargetName="MyAnimatedBrush"
            Storyboard.TargetProperty="Color"
            To="Orange" Duration="0:0:1" />
        </Storyboard>
      </BeginStoryboard>
    </EventTrigger> 
    

    or in code:

    '
    ' Animate the brush's color to orange when
    ' the mouse leaves the rectangle.
    '
    Dim mouseLeaveColorAnimation As New ColorAnimation()
    mouseLeaveColorAnimation.To = Colors.Orange
    mouseLeaveColorAnimation.Duration = TimeSpan.FromSeconds(1)
    Storyboard.SetTargetName(mouseLeaveColorAnimation, "MyAnimatedBrush")
    Storyboard.SetTargetProperty(mouseLeaveColorAnimation, New PropertyPath(SolidColorBrush.ColorProperty))
    Dim mouseLeaveStoryboard As New Storyboard()
    mouseLeaveStoryboard.Children.Add(mouseLeaveColorAnimation)
    AddHandler aRectangle.MouseLeave, Sub(sender As Object, e As MouseEventArgs) mouseLeaveStoryboard.Begin(Me)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there way to animate each letter in a word separately, using only CSS
Is there a way to animate properties of my own classes, using the property
Is there a simple way to animate the color of an object using actionscript
Is there any way to animate a certain div using styles of a class?
is there a way to specify the angle when using $(this).animate({'left': '+=30px'}, 1000); I
Is there a way to animate enabling or disabling a button? I've tried the
IS there an easier way to animate the table view. All the rows in
Is there a built-in way in javascript to animate an object (an image for
is there way how to get name ov event from Lambda expression like with
Is there any way to animate text inside edittext? In my app i use

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.