views:

60

answers:

1

Hi guys,

I'm looking for a way to resize the window when a button is clicked, the reason for this is that I want the user to think that the window is morphing into another window.

Whenever I do resize the window in VSM, it just shows an exception and stacktrace leading to a bunch of errors, so is there a way to accomplish what I'm trying to do?

Thanks

A: 

hey

if you have blend, go try the storyboard, where u can animate the window resize. if u don't have it, here's a little to get you started

<Window.Resources>
    <Storyboard x:Key="resizeWindow">
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(FrameworkElement.Width)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="577"/>
            <SplineDoubleKeyFrame KeyTime="00:00:03" Value="25"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(FrameworkElement.Height)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="469"/>
            <SplineDoubleKeyFrame KeyTime="00:00:03" Value="23.5"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
</Window.Resources>

This is the window going from his start value (577, 469) to an endvalue (25,23.5). U can start this animation at anytime, using this :

Storyboard sStory = (Storyboard)this.Resources["resizeWindow"];
sStory.Begin();

Hope this helps

djerry
Thanks, you kind of gave me an understand, I just re-made it inside the StoryBoard GUI part of the program, thanks anyway.
Sandeep Bansal