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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:24:59+00:00 2026-06-08T12:24:59+00:00

Using .NET 3.5 I have a UserControl with a LinearGradientBrush for the background. I’m

  • 0

Using .NET 3.5

I have a UserControl with a LinearGradientBrush for the background.

I’m wondering how can I cause the whole control to change to a different color and pulsate when a property on the user control changes.

For example if I say MyUserControl.Prop1 = 20 then change the color to red and pulse (by pulsating I mean geting brighter then darker and toggling back and forth). Then when MyUserControl.Prop1 = 0 it returns back the original color.

I would preferably like to keep the gradient background when pusating a different color but if this isn’t possible then so be it

Any pointers or links would be great. I’ve googled this but didn’t find anything useful.

This is my UserControl

<UserControl x:Class="StatusPanel"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Margin="11" >

<Grid>
    <Border Margin="-5" BorderBrush="Black" BorderThickness="1" CornerRadius="30" >
    <Border.Effect>
        <DropShadowEffect />
    </Border.Effect>

    <Border.Background >
        <LinearGradientBrush EndPoint="0,0" StartPoint="1,1">
            <GradientStop Color="White" Offset="0"/>
            <GradientStop Color="Silver" Offset="1"/>
        </LinearGradientBrush>
    </Border.Background>
    </Border>

    <StackPanel Orientation="Vertical">
            <!-- All my user contraols defined here -->
    </StackPanel>    
</Grid>    
</UserControl>
  • 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-08T12:25:01+00:00Added an answer on June 8, 2026 at 12:25 pm

    Can’t post comments for some reason!

    Good answer Greg, thanks for that. Unfortunatly i’m using 3.5 .. forgot to mention that when I first asked the Q

    this is what I did to solve it:

    <UserControl.Resources>
        <Storyboard Name="FadeOutStoryboard" x:Key="FadeOutStoryboard" >
            <DoubleAnimation Storyboard.TargetName="userControlStatusPanel" 
                             Storyboard.TargetProperty="Opacity" 
                             From="1" To="0" Duration="0:0:3" RepeatBehavior="Forever"  />
        </Storyboard>
    </UserControl.Resources>
    
            Storyboard sb = (Storyboard)UserControl.FindResource("FadeOutStoryboard");
            LinearGradientBrush myBrush = new LinearGradientBrush();
            myBrush.EndPoint = new Point(0, 0);
            myBrush.StartPoint = new Point(1, 1);
    
            if (runProgress.Percent == 100)
            {
                myBrush.GradientStops.Add(new GradientStop(Colors.Green, 0));
                myBrush.GradientStops.Add(new GradientStop(Colors.Silver, 1));
                sb.Stop();
            }
            else (runProgress.Percent <= 100)
            {
                myBrush.GradientStops.Add(new GradientStop(Colors.Red, 0));
                myBrush.GradientStops.Add(new GradientStop(Colors.Silver, 1));
                sb.Begin();
            }
            UserControl.borderMain.Background = myBrush;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created .Net usercontrol in C#. it is graphical control with a text
I am using an ASP.Net Web Application project. I have a user control which
I'm developing my ASP.NET web app using VS2010,C#. I have a user control contained
I have an ASP.Net UserControl that looks like this: <%@ Control Language=C# AutoEventWireup=true CodeBehind=WebUserControl1.ascx.cs
I am using a Silverlight usercontrol in my ASP.NET web app. The user control
sending mail along with embedded image using asp.net I have already used following but
using .NET 3.5. I have a function I want to make multithreaded calls to.
So I have a textbox in C# (Using .NET forms) where I am going
I'm using protobuf-net v2 and have a class that inherits List that I wan't
What I have created a very simple asp.net web service using .NET framework 3.5,

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.