如何禁用用户的表单大小调整? [英] How do I disable form resizing for users?
本文介绍了如何禁用用户的表单大小调整?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何禁用用户的表单大小调整?哪些属性被使用?
我试过 AutoSize
和 AutoSizeMode
。
解决方案
将 FormBorderStyle
更改为固定值之一: FixedSingle
, Fixed3D
,
FixedDialog
或 FixedToolWindow
。
FormBorderStyle
属性位于Appearance类别下。 或检查这个
//定义边框样式窗体到一个对话框。
form1.FormBorderStyle = FormBorderStyle.FixedDialog;
//将MaximizeBox设置为false以删除最大化框。
form1.MaximizeBox = false;
//将MinimizeBox设置为false以删除最小化框。
form1.MinimizeBox = false;
//将窗体的起始位置设置为屏幕中心。
form1.StartPosition = FormStartPosition.CenterScreen;
//将窗体显示为模态对话框。
form1.ShowDialog();
How do I disable form resizing for users? Which property is used?
I tried AutoSize
and AutoSizeMode
.
解决方案
Change the FormBorderStyle
to one of the Fixed values: FixedSingle
, Fixed3D
,
FixedDialog
or FixedToolWindow
.
The FormBorderStyle
property is under the Appearance category.
or check this
// 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();
这篇关于如何禁用用户的表单大小调整?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文