Why are my WPF window sizes defaulting to be huge

后端 未结 3 1155
清酒与你
清酒与你 2020-12-20 11:16

I have a wpf application with a few forms. At design time they are small, and they are not set to auto size. However at run time they are giant, even with no content in them

3条回答
  •  难免孤独
    2020-12-20 11:58

    In design you are seeing small because you have blend design properties for the window.

    d:DesignHeight="296" d:DesignWidth="634"

    Since Grid is a dynamic layout it will be stretch to the window's width & height. To restrict you window size you need to mention Height & Width properties to the window.

提交回复
热议问题