b

Friday, 28 December 2012

WPF Button with Image and text and ToolTip

WPF Button with Image and  text and ToolTip


<Button Content="Load" HorizontalAlignment="Left" Margin="114,212,0,0" VerticalAlignment="Top" Width="213" Height="36" x:Name="Load" Click="Load_Click">
           
            <Button.ContentTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                    <Image Source="Mitsubishi Galant.jpg" Width="50"></Image>
                        <TextBlock Width="121" VerticalAlignment="Center"> Mitsubishi...</TextBlock>
                    </StackPanel>
                </DataTemplate>
            </Button.ContentTemplate>
            <Button.ToolTip>
                <StackPanel>
               
                <TextBlock>
                        <TextBlock.Text>Tooltip for Button</TextBlock.Text>
                        <TextBlock.Effect>
                            <BlurEffect>
                            </BlurEffect>
                        </TextBlock.Effect>
                        <TextBlock.FontSize>20</TextBlock.FontSize>
                 </TextBlock>
                       
                </StackPanel>
            </Button.ToolTip>
        </Button>

WPF button demo

No comments:

Post a Comment