<Grid x:Name="LayoutRoot"> <StackPanel x:Name="spButtons" Orientation="Vertical" Visibility="Collapsed" removed="Black" Height="14" Width="500" RenderTransformOrigin="0.502,-0.263" Margin="-157.428,184.483,297.427,281.517" UseLayoutRounding="False" d:LayoutRounding="Auto"> <StackPanel.RenderTransform> <CompositeTransform Rotation="-89.14" TranslateX="-31.313" TranslateY="29.255"/> </StackPanel.RenderTransform> </StackPanel> <Button Margin="436,109,101,333" x:Name="btTest" Height="40" Width="50" MouseEnter="btTest_MouseEnter" MouseLeave="btTest_MouseLeave" /> <Grid.Resources> <Storyboard x:Name="Shrink"> <DoubleAnimation Storyboard.TargetName="spButtons" Storyboard.TargetProperty="Height" From="40" To="14" Duration="00:00:20.0" /> </Storyboard> <Storyboard x:Name="Grow"> <DoubleAnimation Storyboard.TargetName="spButtons" Storyboard.TargetProperty="Height" From="14" To="40" Duration="00:00:00.5" /> </Storyboard> </Grid.Resources> </Grid>
private void btTest_MouseEnter(object sender, MouseEventArgs e) { spButtons.Visibility = Visibility.Visible; Grow.Begin(); } private void btTest_MouseLeave(object sender, MouseEventArgs e) { Shrink.Begin(); spButtons.Visibility = Visibility.Collapsed; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)