.NET控件计算机之间的尺寸变化 [英] .Net controls changing size between computers

查看:128
本文介绍了.NET控件计算机之间的尺寸变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题,我需要找出如何解决,

I have a wierd problem that i need to work out how to resolve,

我已经花了近一对我的笔记本电脑工作项目的工作周,但是当我打开程序的工作PC上控制很多之一是错误的大小和过膝盖等,

I have spent the last couple of weeks working on a project for work on my laptop, but when I open the program on one of the work pcs alot of the controls are the wrong size and over lap etc,

机器之间的区别是这样的:

the differences between the machines is this:

笔记本电脑:

的Windows 7专业版;
显示 - 1920 * 1040;
Visiual Studio 2008中;
的.NET Framework 3.5

Windows 7 Pro; Display - 1920*1040; Visiual Studio 2008; .net framework 3.5

工作桌面:

视窗XP专业版;
显示:1024 * 768;
Visual Studio 2008中;
的.NET Framework 3.5;

windows xp pro; display: 1024*768; visual studio 2008; .net framework 3.5;

,以便更好地discribe这个问题,我有我已经设置为300像素宽,其中有一个标签内的面板一天,白天在MM-DD-yyyy格式,使用Arial和8号字体。

to discribe the problem better, i have a panel which i have set to be 300px wide, which has a label inside with the day and the day in the mm-DD-yyyy format, using arial and size 8 font.

在笔记本电脑这一切完全适合,但桌面上的面板看起来更小和标签只显示一半的文本。

On the laptop it all fits perfectly but on the desktop the panel seems smaller and the label only displays half the text.

这只是众多问题之一,另一个是色彩system.control似乎是系统之间的完全地不同的颜色(althoug我想这是一个WIN7 VS XP问题)

That is just one of many problems, another is with colour system.control seems to be a completly different colour between systems (althoug I figure that to be a win7 vs xp problem)

我能做些什么来解决这个问题?
是一个Windows版本的问题? (我有一个VMware虚拟机在XP上我的笔记本电脑,所以我可以在代码和设计)

What can I do to fix this? is it a windows version problem? (I have xp on a vmware machine on my laptop so i could code and design in that)

这是一个显示问题? - 这对我来说是一个很大的问题,因为我只有1台笔记本电脑,我认为这个问题可能造成我标志着我最近转让了统一的损失(我编写笔记本电脑,今天,直到在桌面上,从来没有打开 - 所以没有任何的想法这个问题)

is it a display problem? - this is a big problem for me as i only have 1 laptop and I think this problem could have caused me mark loss on my recent assignment for Uni (I coded on laptop and never opened on a desktop untill today - so had no idea of this problem)

编辑:我发现各种各样的我的特殊问题的解决方案,我发现我的笔记本电脑正在对125%的视障的dpi设置(不知道如何..)所以我回来重置为100%或96DPI具有固定我的问题,和聊天的一对夫妇的其他开发人员,我知道后,他们说,他们往往以设计为96 DPI,同时留下一点点围绕文本的空白是安全的。但当时他们不倾向于太多,主要的代码都使用C#在C ++中使用Qt框架。

I have found a solution of sorts for my particular problem, I discovered that my laptop was working on 125% on the dpi settings for visually impaired (no idea how..) so I have reset it back to 100% or 96Dpi Which has fixed my problems, and after chatting to a couple of other developers I know, they say that they tend to design for 96 dpi while leaving a little bit of white space around text to be safe. but then they don't tend to use c# much and mainly code all in c++ using QT framework.

推荐答案

视频适配器您的工作站有不同点每英寸设置。该表格​​会自动重新调整自身以适应这一点。

The video adapter in your workstation has a different dots-per-inch setting. The form automatically rescales itself to accommodate that.

这是怎么回事,当你将产品运送,以及发生的,它会在客户端计算机上运行。改变窗体的AutoScaleMode属性不是一个解决方法,这将只是生产在控制剪切文本。确保你的表单设计是有弹性的布局变化。码头,锚,TableLayoutPanel中,FlowLayoutPanel的,Resize事件为碰硬。并确保控件继承其容器的字体属性(在属性窗口不加粗)

This is going to happen as well when you ship your product and it will run on the client's machine. Changing the form's AutoScaleMode property is not a fix, that will just produce clipped text in the controls. Make sure you form design is resilient to layout changes. Dock, Anchor, TableLayoutPanel, FlowLayoutPanel, the Resize event for tough cases. And make sure the controls inherit their container's Font property (not bold in the Properties window)

这篇关于.NET控件计算机之间的尺寸变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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