WPF Image Button formatting

Posted by Sonic Soul on Stack Overflow See other posts from Stack Overflow or by Sonic Soul
Published on 2010-06-08T12:41:35Z Indexed on 2010/06/08 12:42 UTC
Read the original article Hit count: 284

Filed under:

If I create a button with an image inside, it gets blown up to much larger size than the image.

If i try to constrain the size of image, and container button, the image gets cut off:

<Button Background="Transparent" Width="18" Height="18" Margin="0,0,0,0" Padding="0,0,0,0" BorderBrush="{x:Null}">
    <Image Width="16" Height="16" />
</Button>

Native image size is 16x16. Here the button is 18x18 with 0 padding, yet the image still gets cut-off on right/bottom.

how can i make the entire button be exactly the size of the image w/out any cut off?

© Stack Overflow or respective owner

Related posts about wpf