如何根据VB.net中的系统显示结果在WinForms上设置控件 [英] How to Set Controls on WinForms according to System Display Resulution in VB.net

查看:87
本文介绍了如何根据VB.net中的系统显示结果在WinForms上设置控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我有一个带有许多不同控件的窗体,如文本框,标签,按钮,网格等等,我在我的系统分辨率上设计了这个表单,1366x768,现在,当我把这个Windows窗体应用程序带到另一台计算机,其分辨率如1360x768或1280x768或1280x720或1024x768或800x600或系统等任何分辨率等,形式刚刚搞砸了。



我希望所有控件和Form本身根据分辨率调整其高度,宽度,位置。



有没有解决方案请帮忙我......

Hello,

I have a windows form with many different controls like textbox,lable,button,grid etc etc, I have design this form on my system resolution, 1366x768 , now when i take this Windows Form Application to another computer which have resolution like 1360x768 OR 1280x768 OR 1280x720 OR 1024x768 OR 800x600 or any resolution on System etc etc , form just got mess up.

I want that all controls and Form itself adjust its Height, width, Location according to resolution.

Is there any Solution For This Please Help Me......

推荐答案

我设计的应用假设分辨率为800 x 600,因为增长或拉伸控制很容易。我不知道如何缩小它们。基本上你应该看看锚属性 [ ^ ]。如果你告诉它锚定到左上角...它将始终保持相同的大小和左上角。但是,如果你告诉它锚定到左上方右侧,当窗体重新调整大小时,它会向右伸展。掌握它如何工作的最好方法是稍微玩一下。您可能也对停靠属性感兴趣 [ ^ ]。



希望这会有所帮助。
I design my apps assuming a resolution of 800 x 600 because growing or stretching controls is easy. I have no idea how to shrink them. Basically you should look at the anchor property[^] of each control. If you tell it to anchor to the Top Left...it will always stay the same size and on the top left. But if you tell it to anchor to the Top Left Right, it will stretch to the right when the form is re-sized. The best way to get a handle on how it works is to play with it a bit. You also may be interested in the dock property[^].

Hope this helps.


这篇关于如何根据VB.net中的系统显示结果在WinForms上设置控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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