如何根据屏幕分辨率自动调整表单控件的大小 [英] How to Reize automatically form control according to screen resolution

查看:146
本文介绍了如何根据屏幕分辨率自动调整表单控件的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何根据屏幕分辨率自动调整表单控件的大小

How to Reize automatically form control according to screen resolution

推荐答案

您将使用 WindowState [
You will find the resolution using the Screen[^] class.

Or you can set the WindowState[^] property to FormWindowState.Maximized

Regards
Espen Harlinn


基本上,锚点和停靠属性用于根据屏幕分辨率调整控件的大小,但前提是您的表单中有很多控件..
使用TablelayoutFlowlayout panel的最佳方法,因为它具有功能FlowLayoutPanel控件和TableLayoutPanel控件提供了在窗体上排列控件的直观方法.
TableLayoutPanel控件在运行时提供了比例调整大小的功能,因此您可以在调整表单大小时平滑地更改布局,并且所有控件都锚定在保留它们的单元格的所有侧面.
简而言之,我建议您在需要动态布局并且不想在代码中显式处理Layout事件时,则应考虑使用布局面板.
要知道如何使用面板,请
[ ^ ]
basically anchor and dock properties is used to resize control according to screen resolution but in case you have lots of control in your form then..
The best way to use Tablelayout,Flowlayout panel because of its feature The FlowLayoutPanel control and the TableLayoutPanel control provide intuitive ways to arrange controls on your form.
The TableLayoutPanel control provides a proportional resizing capability at run time, so your layout can change smoothly as your form is resized as well as All the controls are anchored to all the sides of cell in which you keep them.
In short I will suggest you to When you need a dynamic layout and you do not want to handle Layout events explicitly in your code, thn you should consider using a layout panel.
to know how to use panels go there[^]


使用锚点和停靠属性来调整控件的大小
查找更多信息[^]
use Anchor and dock properties for resizing the controls
Find More[^]


这篇关于如何根据屏幕分辨率自动调整表单控件的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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