开发者

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>


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜