Ensuring that application is independent of users' screen resolution

帅比萌擦擦* 提交于 2020-01-04 06:15:11

问题


Is there any easy way to run an application created in C# on Visual Studio 2005 on any different PC, regardless of its screen resolution?


回答1:


Screen resolution?

Windows Forms in .NET 2.0 has some mechanisms for dealing with different DPI and it has a better layout system than in .NET 1.1. In general, use layout panels like FlowLayoutPanel, TableLayoutPanel, etc instead of fixing your controls at X/Y coordinates and you'll have a much easier time dealing with different window sizes.

If you can use WPF which I don't recall being applicable to Visual Studio 2005, then you have much more options for resolution independence. The DPI issue goes away and WPF has features such as ViewBox that lets you scale an entire window or control uniformly.



来源:https://stackoverflow.com/questions/4590488/ensuring-that-application-is-independent-of-users-screen-resolution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!