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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:33:19+00:00 2026-05-20T06:33:19+00:00

Is there a way to resize a WPF UserControl in such a way that

  • 0

Is there a way to resize a WPF UserControl in such a way that the child controls don’t flop around?

I’ve got this Storyboard:

<Storyboard>
    <DoubleAnimation Storyboard.TargetProperty="Height" Storyboard.TargetName="MyUserControl" To="145" From="0" Duration="0:0:1" />
</Storyboard>

This works great; it takes my control from Height Zero to Height 145 — the problem is that as the Height property changes, all of the child controls inside start jumping around, I suspect, due to their HorizontalAlignment and VerticalAlighment properties. Is there a way I can disable that until the animation is finished?

I’m trying to create the illusion of this UserControl “sliding” into view — so I’m open to other approaches if I’m going about this wrong.

  • 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-20T06:33:20+00:00Added an answer on May 20, 2026 at 6:33 am

    Everything is “jumping around” because every time the Height of the control is changed all the containing controls reposition themselves according to the new available space.

    To achieve the desired effect you should use RenderTransform instead of changing the actual Height of the control.

    Here is how you can do that. First, add ScaleTransform as a value of RenderTransform property on your control:

    <MyUserControl.RenderTransform>
        <ScaleTransform ScaleY="0" />
    </MyUserControl.RenderTransform>
    

    Then, modify target property of your animation to change the ScaleY property of the transform:

    <Storyboard>
        <DoubleAnimation Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleY)" Storyboard.TargetName="MyUserControl" To="145" Duration="0:0:1" />
    </Storyboard>
    

    Update:

    Another way to achieve the slide-into-view effect is to use TranslateTransform with negative Y value:

    <MyUserControl.RenderTransform>
       <TranslateTransform Y="-1000" />
    </MyUserControl.RenderTransform>
    

    And then, animate its Y property to 0:

    <Storyboard>
        <DoubleAnimation Storyboard.TargetProperty="RenderTransform.(TranslateTransform.Y)" Storyboard.TargetName="MyUserControl" To="0" Duration="0:0:1" />
    </Storyboard>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there any way to determine the visible region of a WPF control that
Is there any way by which I can disable GridViewColumn resize in WPF? I
Is there a way to resize a std::vector to lower capacity when I no
Is there a way to resize an image (Taken from the Camera or UIImagePicker
Is there a way to proportionally resize an image if the height and width
Is there way to set @include mixin(); to variable? I tried this @mixin bg-gradient($fallback,
Is there a way to automatically resize the background image of an element. For
I have a customized WPF control that is derived from UserControl. In the Resources
Is there any way to resize pictures while uploading them in Symfony2 ? The
If there was a way to resize the heap by passing Xmsn to the

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.