如何禁用调整大小 [英] how to disable resizing

查看:78
本文介绍了如何禁用调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我正在wpf页面上工作,我需要停止调整页面大小,但是我想保持最大化按钮以最大化页面,我想设置MinHeight和MinWidth.
并停止用户调整大小,但是我想允许在按下最大化按钮时允许最大化页面
任何想法吗?.

thx 谢谢大家.

Hi all
i am working on wpf page and i need to stop resizing from the page but i want to keep maximize button in order to maximize page, i want to set MinHeight and MinWidth.
and stop user resizing, but i want to allow maximize page on pressing on maximize button
any idea for this??.

thx Thanks for all.

推荐答案



我希望这可以解决您的问题....

Hi,

I hope this would solve your problem....

// Define the border style of the form to a dialog box.
       form1.FormBorderStyle = FormBorderStyle.FixedDialog;
  // Set the MaximizeBox to false to remove the maximize box.
       form1.MaximizeBox = true;
  // Set the MinimizeBox to false to remove the minimize box.
       form1.MinimizeBox = false;
  // Set the start position of the form to the center of the screen.
         form1.StartPosition = FormStartPosition.CenterScreen;
  // Display the form as a modal dialog box.
       form1.ShowDialog();


这篇关于如何禁用调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆