Tuesday, 12 July 2016

WPF Button with Image and Text

<Button x:Name="Image_Button" Height="100" Width="230">
        <Button.Template>
                <ControlTemplate TargetType="Button">
                    <StackPanel Orientation="Horizontal"
                                Background="SkyBlue">
                        <Image Name="Button_Image"
                               Margin="5,0,0,0"
                               Source="Button.png"
                               HorizontalAlignment="Center"
                               Width="95"
                               Height="95"
                               VerticalAlignment="Center"
                               Visibility="Visible" />
                        <TextBlock x:Name="HomeText"
                                   Text="Button"
                                   VerticalAlignment="Center"
                                   HorizontalAlignment="Center"
                                   FontSize="34"
                                   Foreground="White"
                                   Margin="10,0,0,0"
                                   FontWeight="SemiBold"/>
                    </StackPanel>
                </ControlTemplate>
          </Button.Template>
 </Button>



Output :






No comments:

Post a Comment