几周后,WPF应用程序突然重新调整大小

时间:2014-03-12 10:06:08

标签: asp.net wpf resize

我有一个WPF应用程序,如下所示:

https://drive.google.com/file/d/0B-wl9oJvpFRsUE1QZ3ZwNjVaWTA/edit?usp=sharing

我和我的一些客户一起安装它并且它运行了好几周,但之后我收到了抱怨,该应用程序突然重新调整大小看起来像这样:

https://drive.google.com/file/d/0B-wl9oJvpFRscHpSMTBTMmVmZEU/edit?usp=sharing

Window标记具有以下属性:

<Window x:Class="Blabla.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        StateChanged="Window1_StateChanged" Icon="Ico.ico"
        Title="PRAMS Connect" Width="522" SizeToContent="Height" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">

如果他们重新安装应用程序,他们的屏幕将恢复正常大小。

知道这里发生了什么吗?

非常感谢

1 个答案:

答案 0 :(得分:0)

尝试在窗口中添加最小高度和宽度;

<Window x:Class="Blabla.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    StateChanged="Window1_StateChanged" Icon="Ico.ico"
    Title="PRAMS Connect" Width="522" SizeToContent="Height" 
    WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize"
    MinWidth="522" MinHeight="Whatever the height is...">
相关问题