Pendulum Button : Button « Windows Presentation Foundation « VB.Net Tutorial






<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:s="clr-namespace:System;assembly=mscorlib">
    <StackPanel Width="200">
        <Line X1="100" X2="100" Y2="200"
              StrokeThickness="3" Stroke="Black" />

        <Button Content="{x:Static s:DateTime.Now}"
                HorizontalAlignment="Center" />

        <StackPanel.RenderTransform>
            <RotateTransform x:Name="xform" CenterX="100" />
        </StackPanel.RenderTransform>

        <StackPanel.Triggers>
            <EventTrigger RoutedEvent="StackPanel.Loaded">
                <BeginStoryboard>
                    <Storyboard TargetName="xform" TargetProperty="Angle">
                        <DoubleAnimation From="-30" To="30" Duration="0:0:1" 
                              AccelerationRatio="0.5" DecelerationRatio="0.5"
                              AutoReverse="True" RepeatBehavior="Forever" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </StackPanel.Triggers>
    </StackPanel>
</Page>
WPF Pendulum Button








16.6.Button
16.6.1.Rotated ButtonsRotated Buttons
16.6.2.Pendulum ButtonPendulum Button
16.6.3.Set Button Content with element valueSet Button Content with element value
16.6.4.Set Button Width,Height and Content String by using AttributesSet Button Width,Height and Content String by using Attributes
16.6.5.Use Button.Content to set the content for a ButtonUse Button.Content to set the content for a Button
16.6.6.Adding image to a ButtonAdding image to a Button
16.6.7.Button with no position and sizeButton with no position and size
16.6.8.Button with Property AttributesButton with Property Attributes
16.6.9.Button with Property ElementsButton with Property Elements
16.6.10.Button with default Xml namespaceButton with default Xml namespace
16.6.11.Button with named NamespaceButton with named Namespace
16.6.12.Button Based On StyleButton Based On Style
16.6.13.Property Trigger for ButtonProperty Trigger for Button
16.6.14.Layout TranformLayout Tranform
16.6.15.Using alternate elements as the content of a ButtonUsing alternate elements as the content of a Button
16.6.16.Button's Background = ImageBrush. The resulting button has an image as its backgroundButton's Background = ImageBrush. The resulting button has an image as its background
16.6.17.A rotated ButtonA rotated Button
16.6.18.Using Button.Content to set content for ButtonUsing Button.Content to set content for Button
16.6.19.A button that has been skewed and rotatedA button that has been skewed and rotated
16.6.20.Button PreviewMouseDown action and MouseDown actionButton PreviewMouseDown action and MouseDown action
16.6.21.Add CommandTarget for ButtonAdd CommandTarget for Button
16.6.22.Adding graphics to a ButtonAdding graphics to a Button
16.6.23.Button with image and text, use grid to layout Button contentButton with image and text, use grid to layout Button content
16.6.24.Canvas with Button onCanvas with Button on
16.6.25.Resizing ButtonsResizing Buttons
16.6.26.To add a button control and a text block to the canvasTo add a button control and a text block to the canvas
16.6.27.A simple template for a round buttonA simple template for a round button
16.6.28.Load style defined in Xaml and apply to the ButtonLoad style defined in Xaml and apply to the Button
16.6.29.Nested Button contentNested Button content
16.6.30.Two repeat buttons that increase and decrease a numerical value.Two repeat buttons that increase and decrease a numerical value.
16.6.31.Set button properties with Linq styleSet button properties with Linq style
16.6.32.Simple Custom ButtonSimple Custom Button
16.6.33.Button VerticalAlignment=Top HorizontalAlignment=LeftButton VerticalAlignment=Top  HorizontalAlignment=Left