4

I have an image in my resources and I want to provide it as background of my button in windows phone. How to do that? I tried this , but giving an error

<Button Content="" HorizontalAlignment="Left" BorderBrush="Transparent" Margin="131,681,0,0" Name="button2" Width="81" Grid.Row="1" Click="button2_Click" Height="64" VerticalAlignment="Top" Background="Images/pause.png"/>
4

1 回答 1

4

尝试这个,

    <Button Content="" HorizontalAlignment="Left" Margin="114,36,0,0" Grid.Row="1" VerticalAlignment="Top">
        <Button.Background>
            <ImageBrush Stretch="Fill" ImageSource="/Images/pause.png"/>
        </Button.Background>
    </Button>
于 2012-04-12T03:45:45.507 回答