Create FishEye Effect Buttons by changing the Button font size : Font « Windows Presentation Foundation « C# / C Sharp






Create FishEye Effect Buttons by changing the Button font size

Create FishEye Effect Buttons by changing the Button font size
       

<StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <StackPanel.Resources>
        <Style TargetType="{x:Type Button}">
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="FontSize" Value="12" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation 
                                    Storyboard.TargetProperty="FontSize"
                                    To="36" Duration="0:0:1" />
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>

                    <Trigger.ExitActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation 
                                    Storyboard.TargetProperty="FontSize"
                                    To="12" Duration="0:0:0.25" />
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.ExitActions>
                </Trigger>
            </Style.Triggers>
        </Style>
    </StackPanel.Resources>

    <Button>Button No. 1</Button>
    <Button>Button No. 2</Button>
    <Button>Button No. 3</Button>
</StackPanel>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Font Properties MovedFont Properties Moved
2.Animate TextBox Font SizeAnimate TextBox Font Size
3.Font ViewerFont Viewer
4.Programmatically change the FontFamily property of a TextBlock element.Programmatically change the FontFamily property of a TextBlock element.
5.Font Properties SampleFont Properties Sample