How to leave my Button disabled but appearing the image?

Asked

Viewed 66 times

2

Does anyone know if there is any option for me to leave my Button disabled but showing the Button image?

What happens if I disable Button.

inserir a descrição da imagem aqui

Button XAML code.

<Button x:Name="BtnCalc" Content="" HorizontalAlignment="Left" Margin="773,206,-172,0"
        VerticalAlignment="Top" Width="200" Click="BtnCalc_Click" Height="85"
        BorderBrush="{x:Null}">
    <Button.Background>
        <ImageBrush ImageSource="images/calculador.png"/>
    </Button.Background>
</Button>

1 answer

1


Thus:

Put a <Button.Content> within a <StackPanel> and finally a <Image>, will solve this problem

<Button Name="BtnCalc"
        HorizontalAlignment="Left"  
        Margin="53,62,0,0"
        VerticalAlignment="Top" Width="266" Height="136" Click="BtnCalc_Click_1">
    <Button.Content>
        <StackPanel>
            <Image Source="images/1.jpg"></Image>
        </StackPanel>
    </Button.Content>
</Button>

These are an example of you with the measurements of the image.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.