我可以告诉Visual Studio中不改变项目的DPI? [英] Can I Tell Visual Studio not to Change the DPI of a Project?

查看:1381
本文介绍了我可以告诉Visual Studio中不改变项目的DPI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从.NET 1.1转换为3.5一期工程于2008年被开发出来。

I have a project converted from .NET 1.1 to 3.5 being developed in 2008.

如果我打开Windows 7中的项目,将其转换一切的大小120DPI大小。如果我再有96 DPI打开它,它变回。有没有什么办法,我发展,所以它看起来在这两个好,的的有Visual Studio的改变大小,如果用不同的DPI的系统上开了?

If I open the project on Windows 7, it converts the size of everything to 120dpi sizes. If I then open it with 96 dpi it changes back. Is there any way for me to develop so it looks good in both, and not have Visual Studio change the sizes if opened on a system with different DPI?

这问题也许是更好的措辞/复制在这里:
Visual Studio设计的DPI设置

This question is perhaps better phrased/duplicated here: visual studio designer dpi setting

或者在这里:
Visual Studio和DPI问题

需要明确的是什么,我要做的是防止被调整在设计时使用多个开发者使用不同的DPI设置控制。当我发现这个问题的所有情况下,我一直在使用升级为使用Visual Studio 2008的最初,目前的Visual Studio 2010的.NET 1或.NET 2项目。

To be clear what I am trying to do is prevent the control from being resized in the designer when being used by multiple developers with different DPI settings. In all cases where I've noticed this issue I've been working with a .NET 1 or .NET 2 project upgraded to use Visual Studio 2008 originally, now Visual Studio 2010.

更新(万一有人想用@Ben奖励积分争夺):我有正确调整大小形式,但窗口的大小被改变编程。因为设计师是不知道的尺寸,窗口调整大小,如果不正确地使用不同的DPI的显影剂接触的形式。 ?有没有解决不是要回不结垢在运行时,用户界面等这个问题得到的一种方式。

Update (in case anyone wants to compete with @Ben for bonus points): I have a form which resizes correctly, but the size of the window gets changed programmatically. Because the designer isn't aware of the dimensions, the window resizes incorrectly if a developer using a different DPI touches the form. Is there a way of getting around that problem other than going back to not scaling the UI at runtime?

例如:我有两个大小我的窗口宣布,该工作正确如果开发人员使用120 DPI在设计时:

For instance: I have two sizes for my window declared, which work correctly if developers use 120 dpi at design time:

private static Size smallSize = new Size(960, 500);
private static Size largeSize = new Size(960, 615);



我只是试图总结我的头围绕什么,我需要做的,不是有一个可怕的设计的回归,如果有人编辑在96DPI设计的形式。

I'm just trying to wrap my head around what I would need to do to not have a horrible design regression if someone edits the form in a 96dpi designer.

推荐答案

AutoScaleMode = AutoScaleMode.None;

另请参阅: ContainerControl.AutoScaleMode 属性

See also: ContainerControl.AutoScaleMode property

这篇关于我可以告诉Visual Studio中不改变项目的DPI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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