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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:59:21+00:00 2026-05-29T11:59:21+00:00

Silverlight newbie here, so I apologize if this question isn’t even worded correctly. I

  • 0

Silverlight newbie here, so I apologize if this question isn’t even worded correctly.

I am playing around with a richtextbox and storyboard animations. Basically, on mouseenter animate to 100px, on mouseleave animate to 0px.

This is fairly basic, but what I can’t figure out is how to see if it is in the minimize or maximize state.

Here is the XAML:

<UserControl x:Class="AnotherTester.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>
    <Storyboard x:Name="Shrink">
        <DoubleAnimation Storyboard.TargetName="textBox" 
            Storyboard.TargetProperty="Height"
            From="100" To="0" Duration="00:00:00.5" />
    </Storyboard>
    <Storyboard x:Name="Grow">
        <DoubleAnimation Storyboard.TargetName="textBox" 
            Storyboard.TargetProperty="Height"
            From="0" To="100" Duration="00:00:00.5" />
    </Storyboard>
</UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">
    <StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Width="100">
        <Rectangle x:Name="rectangle" Fill="#FF0202F9" Height="20" Stroke="Black" Width="100" MouseEnter="rectangle_MouseEnter" MouseLeave="rectangle_MouseLeave" />
        <RichTextBox x:Name="textBox" Height="100">
            <Paragraph><Run Text="This"/></Paragraph>
            <Paragraph><Run Text="is"/></Paragraph>
            <Paragraph><Run Text="some"/></Paragraph>
            <Paragraph><Run Text="awesome"/></Paragraph>
            <Paragraph><Run Text="text"/></Paragraph>
        </RichTextBox>
    </StackPanel>

</Grid>

And the code Behind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace AnotherTester
{
public partial class MainPage : UserControl
{

    public MainPage()
    {
        InitializeComponent();
    }

    private void rectangle_MouseEnter(object sender, MouseEventArgs e)
    {
        Grow.Begin();
    }

    private void rectangle_MouseLeave(object sender, MouseEventArgs e)
    {    
        Shrink.Begin();
    }
}
}

EDIT:
Ok, I just changed the starting height of the control to 0px, which gave me the effect I was looking for (all collapsed boxes until we mouse over them), but I would still like to know how to check against things like this..

  • 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-29T11:59:23+00:00Added an answer on May 29, 2026 at 11:59 am

    on solution would be to use the storyboards completed event to let you set the state.

    example

    Grow.Completed += (o,e) => _isCollapsed = true;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Silverlight newbie question: I've got a small Silverlight application with the following XAML snippet:
Newbie question... I am using silverlight to POST data to my GAE application class
I'm sure that this is a simple newbie question, but the answer is eluding
I am a newbie in this Silverlight Databinding subject. I am starting to understand
I'm a Silverlight newbie. Just downloaded version 3.0 after the Mix announcement. I'm running
I am a newbie with F# and SL and playing with getting asynchronous HttpResponse
I'm newbie to silverlight. Please help me find setting page title. See I don't
I'm a newbie to Silverlight and I'm having some trouble finding a solution to
Silverlight virgin here. How do I make the usercontrol surrounding my grid automatically resize
I have this problem in this scenario: 1-I made a new silverlight project with

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.