c# - 如何修复 C# Windows 窗体应用程序中的窗体大小而不让用户更改其大小?

标签 c# .net winforms size fixed

如何在 C# Windows 窗体应用程序中修复窗体大小而不让用户更改其大小?

最佳答案

检查这个:

// 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();

关于c# - 如何修复 C# Windows 窗体应用程序中的窗体大小而不让用户更改其大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2910537/

相关文章:

c# - Entity Framework 中的 HierarchyID 不起作用

c# - 如何在 WinRT 中获取类的属性

c# - 使用 JSON 的 WCF RESTful POST,来自 Windows 应用商店应用

.net - WPF 运行时控件创建

c# - unity RegisterInstance IDisposable对象

.net - 找不到方法 : 'Void System.Security.Claims.ClaimIdentity..ctor(System.Security.Claims.ClaimIdentity)'

java - 我在哪里可以找到 "reference barcodes"来验证条码库输出?

c# - 如何启用窗体上的所有控件?

c# - 数据 GridView 和绑定(bind)列表 : How to check if cell value has changed?

c# - 始终选中一行的 DataGridView