Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Button Disappearing on Resize

In a WPF application I'm developing, I intend to have a number of buttons on the left in a separate grid, however, when I resize the application (making it smaller) the button shrinks and eventually disappears.

I know there's obviously something I'm overlooking, but I can't find out what it is.

Here's the XAML for that grid:

<Grid HorizontalAlignment="Left"
      Margin="0,23,0,0"
      Name="pnlNav"
      VerticalAlignment="Stretch"
      Width="200">
    <Button Content="Team Open"
            Height="31"
            Name="btnTeamOpen"
            Width="144"
            Click="btnTeamOpen_Click"
            Margin="26,44,30,533" />
</Grid>
like image 768
Joe Avatar asked Jun 06 '11 00:06

Joe


1 Answers

Your button has a ridiculous margin: Margin="26,44,30,533"

This means the button has to be over 500px from the bottom, clippling occurs if the available space is smaller than the top margin + height + bottom margin.

(MSDN article on the layout system & Alignment, Margins & Padding)

like image 165
H.B. Avatar answered Oct 03 '22 00:10

H.B.