Using Image with Button in Silverlight


In xaml page,

<Button Height="33" Name="btnAdd" Width="78" Margin="54,0,0,0 >
  <!--<Button.Content>-->
       <StackPanel>
          <Image Height="15" HorizontalAlignment="Left" Name="imgTest" Stretch="Fill" VerticalAlignment="Top" Width="47" Source="Images/Puts.png" />
          <TextBlock Name="txtAdd" Margin="5,0,0,0">Add</TextBlock>
       </StackPanel>
  <!--</Button.Content>-->
</Button>

Instead of stack panel, we can use ‘Button.Content’ also depending on the situations.

No comments:

Post a Comment