安装在较低分辨率的PC后,Windows窗体控件会被裁剪? [英] Windows form controls gets cropped after installing in lower resolution pc ?

查看:70
本文介绍了安装在较低分辨率的PC后,Windows窗体控件会被裁剪?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个屏幕分辨率为(1366 x 768)的应用程序。但是当我在较低分辨率的计算机中安装此应用程序时说(1280 x 1024),然后启动我的应用程序按钮和文本框从末尾开始裁剪而在另一种形式中,datagridview反复显示列,而它们只绑定一次并在我的电脑中出现一次,为什么它发生了什么?请建议我摆脱这个的方法。

解决方案

基本上?如果没有对用户界面进行大量的重新设计,你就不能这样做。

WinForms并不擅长控制缩放,除非你从中央工作区开始设计它,否则很少看起来很好由可停靠的工具区域包围 - VS的设计方式。



填充控件的单个表单无法轻松自动缩放,因为字体大小用于控件大小时控件不会改变,中间有一个带有小文本的巨大按钮,或者隐藏了大部分文本的小按钮。



您可以通过重新设计用户界面来使用多个表单或选项卡来减少任何时候可见的控件数量,并以更小的空间以这种方式适应所有内容,从而改善用户体验也很好 - 一个充满控件的显示器通常会让人感到困惑和尴尬。

但是自动重新缩放从来都不能正常工作。

基本上Windows窗体不会根据分辨率调整它们的外观和感觉,你需要使用TableLayout面板和锚标签来完成它。

DOCK和ANCHOR将帮助您保持屏幕分辨率的控制比,但您需要处理每个控件

请参阅以下链接,它可能会帮助您更多

在.net中制作与分辨率无关的Windows应用程序 [ ^ ]


I developed one application in screen resolution of (1366 x 768) . but when i install this application in lower resolution computer say (1280 x 1024) , and starts my application buttons and textboxes gets cropped from end and in another form datagridview shows columns repeatedly whereas they are bound only once and appearing once in my pc , why it happend ? please suggest me ways to get rid of this.

解决方案

Basically? You can't, without a substantial redesign of your user interface.
WinForms is not good at control scaling, and it rarely looks good unless you design it form the beginning for that with a central "work area" surrounded by dockable tool areas - the way that VS is designed.

A single form stuffed with controls can't be easily scaled automatically, as the font size used for the controls doesn't change when the control size does, leaving you with either a huge button with tiny text in the middle, or a tiny button with most of the text hidden.

You may be able to get round it by redesigning your user interface to use multiple forms or tabs to reduce the number of controls visible at any one time and fit everything in that way in a smaller space, and that can improve the user experience as well - a display full of controls is normally confusing and awkward to use.
But automatic rescaling just never works nicely.


Basically windows forms do not adjust their look and feel depend upon resolution, you need to take use of TableLayout panel and anchor tags to get it done.
DOCK and ANCHOR will help you to maintain your control ratio with screen resolution but you need to work on each control
see following link, it may help you more
Make resolution independent windows app in .net[^]


这篇关于安装在较低分辨率的PC后,Windows窗体控件会被裁剪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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