1

I have a WPF window. I want to disable the ResizeMode from the user, that means, I want to ignore any resize that the user will try to do but I want to leave the ResizeMode as "CanResizeWithGrip".

How to do this?

4

2 回答 2

1

将对值MinWidthMaxWidth/或MinHeightMaxHeight设置为相同的值。像这样,您甚至可以单独指定用户是否可以垂直、水平调整大小或根本无法调整大小

于 2013-05-28T10:36:15.477 回答
1

只需在窗口的加载事件中添加以下代码:

        this.MaxWidth = this.Width;
        this.MaxHeight = this.Height;

它会解决你的问题。我希望它会帮助你。:)

于 2013-05-28T10:46:55.453 回答