Pra*_*ana 250
更改FormBorderStyle为固定值之一:FixedSingle,Fixed3D,
FixedDialog或FixedToolWindow.
该FormBorderStyle物业属于外观类别.
或检查一下
// 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();
Run Code Online (Sandbox Code Playgroud)
San*_*ile 43
使用FormBorderStyle属性,制作它FixedSingle
this.FormBorderStyle = FormBorderStyle.FixedSingle;
Run Code Online (Sandbox Code Playgroud)
Jav*_*ram 15
使用FormBorderStyle你的财产Form
this.FormBorderStyle = FormBorderStyle.FixedDialog;
Run Code Online (Sandbox Code Playgroud)
更改此属性并在设计时尝试此操作:
FormBorderStyle = FormBorderStyle.FixedDialog;
Run Code Online (Sandbox Code Playgroud)
更改前的设计器视图:
使用MaximumSize和MinimumSize形式的特性,将修复窗体大小,并防止用户调整的形式,同时保持默认的形式FormBorderStyle.
this.MaximumSize = new Size(XX, YY);
this.MinimumSize = new Size(X, Y);
Run Code Online (Sandbox Code Playgroud)
小智 5
我总是用这个:
// Lock form
this.MaximumSize = this.Size;
this.MinimumSize = this.Size;
Run Code Online (Sandbox Code Playgroud)
这样,您始终可以从Designer中调整表单的大小,而无需更改代码。