Mega Code Archive

 
Categories / VB.Net Tutorial / WPF
 

Button with image and text, use grid to layout Button content

<Window x: Class="Containment.Window1"   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   Title="Containment">      <Button Width="100" Height="100">     <Button.Content>       <Grid>         <Grid.RowDefinitions>           <RowDefinition />         </Grid.RowDefinitions>         <Image Grid.Row="0" Source="c:\image.png" />         <TextBlock Grid.Row="1" HorizontalAlignment="Center">Tom</TextBlock>       </Grid>     </Button.Content>   </Button>    </Window>