如何在 C# Windows Forms 应用程序中修复表单大小而不让用户更改其大小?
问问题
120081 次
7 回答
81
检查这个:
// 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 = false;
// 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();
于 2010-05-26T06:37:59.113 回答
19
尝试设置
this.MinimumSize = new Size(140, 480);
this.MaximumSize = new Size(140, 480);
于 2012-11-29T11:40:59.147 回答
12
防止调整事件大小的最小设置
form1.FormBorderStyle = FormBorderStyle.FixedDialog;
form1.MaximizeBox = false;
于 2014-01-11T00:51:12.537 回答
10
属性 -> FormBorderStyle -> FixedSingle
如果您找不到您的属性工具。转到查看-> 属性窗口
于 2013-12-23T23:14:29.783 回答
4
我很确定这不是最好的方法,但是您可以将MinimumSize
andMaximimSize
属性设置为相同的值。那会阻止它。
于 2010-05-26T06:34:31.650 回答
0
将Maximize属性设置为False。
于 2016-06-16T08:11:15.690 回答