如何调整表格尺寸? [英] How can i adjust my Form Size?

查看:158
本文介绍了如何调整表格尺寸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VB.Net进行项目.

我的表单(Frm_Main)当前以1600 * 1900的分辨率运行.

当我在另一台分辨率为1366 * 768的计算机上运行时,我的(Frm_Main)大于屏幕尺寸,并且某些窗体的组件正在屏幕外显示.

I am doing a project with VB.Net.

My Form (Frm_Main) is currently running in 1600*1900 resolution.

When i run in another computer which have 1366*768 resolution, My (Frm_Main) is larger than screen size and some of the form''s components is displaying outside of the screen.

How can i do my (Frm_Main) size to compatable with all screen''s resolution?

推荐答案

在大多数情况下,您不能这样做.
您可以在WPF中使用,因为它的设计不同,并且内置了缩放比例-但Winformas应用程序不能缩放,并且通常缩放效果不佳.有一些方法可以自动移动和调整控件的大小,但它根本不影响文本,并且可以使事物看起来很奇怪或不可读.

如果您需要首先设计一个1600x1900的Winforms来适合所有控件,那么我怀疑您需要仔细查看UI并减少控件数量-只是为了使其对用户更有用.在选项卡页面上对控件进行分组可能是一种方法.
You can''t, in most cases.
You can in WPF, because it is designed differently, and has zooming an scales built in - but Winformas apps do not, and generally do not scale well. There are ways to move and resize controls automatically, but it it does not affect text at all, and that can make things look for strange, or unreadable.

If you need to design a winforms at 1600x1900 to fit all your controls in the first place, then I suspect you need to look at your UI in some detail, and reduce the controls count - if only to make it more usable for the user. Grouping controls on tab pages may be a way to go.


通过将项目添加到TableLayout Panel并将此代码写入form_Load

By adding items to TableLayout Panel and writing this code to form_Load

If SystemInformation.WorkingArea.Height > 1200 Then
          Me.Scale(New SizeF(1.3F, 1.3F))
      End If


这篇关于如何调整表格尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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