修复C#Windows窗体中的表单大小 [英] Fix Form Size in C# Windows Form

查看:68
本文介绍了修复C#Windows窗体中的表单大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#中设置固定表单大小?如果我在中心运行申请表怎么办?

解决方案

你的意思是你不想要一个相当大的窗口?如果是这种情况,请使用例如<$ h $ = http://msdn.microsoft.com/en-us/library/system.windows.forms的 FixedSingle 。 form.formborderstyle.aspx> FormBorderStyle [ ^ ]



要使窗口居中,可以使用 StartPosition [ ^ ]


如果你将表格的formborderstyle设置为fixeddialog,那么表单不够大。

你也可以设置表单开始位置,使其在整个屏幕中心或只是应用程序的中心。

只需点击表格并检查使用属性检查器的表单属性。


右键单击表单并转到属性。然后转到布局选项,看到有一个名为Size的属性。根据宽度和长度明确需要它。还需要在Size属性之后看到名为StartPosition的属性。选择它作为CentreScreen ..它将从您的屏幕中心开始您的表单。您还可以通过在表单加载期间编码来更改这两个属性。根据您的要求使用最佳的..


How to set Fixed Form Size in C#? And If I Run The Application form in Center How to do?

解决方案

You mean you don't want a sizable window? If that's the case, use for example FixedSingle for FormBorderStyle[^]

To center the window, you can use StartPosition[^]


If you set the form's formborderstyle to fixeddialog, then the form is not sizeable.
Yyou can also set the form startposition to make it center the entire screen or just center towards the application.
Just click the form and inspect the properties of the form using the property inspector.


Right click on your form and go to properties.Then go to Layout options,see there are a property named Size.Change it as your need as width and length wise.Also see a property named StartPosition just after the Size property.Select it as CentreScreen..it will start your form from center of your screen.You can also change these two properties by coding during form load.Use best one according to your requirement..


这篇关于修复C#Windows窗体中的表单大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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