如何在wpf应用程序中设置默认的全屏分辨率此应用程序在任何桌面分辨率下都会显示全屏 [英] how to set default full screen resolution in wpf application this application show full screen in any desktop resolution

查看:211
本文介绍了如何在wpf应用程序中设置默认的全屏分辨率此应用程序在任何桌面分辨率下都会显示全屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在wpf应用程序中设置默认全屏分辨率

此应用程序在任何桌面分辨率下全屏显示

在我的应用程序中我的默认分辨率为(750,1360)

但当我运行此应用程序时,其他桌面无法正常显示

i希望此应用程序在任何桌面上全屏显示

how to set default full screen resolution in wpf application
this application show full screen in any desktop resolution
in my application my default resolution is (750,1360)
but when i run this application other desktop they can't show properly
i want this application show full screen at any desktop

推荐答案

如果我理解你,你想改变Windows应用程序的大小,而不是屏幕分辨率。你希望在普通窗体中实现类似于最大化模式的东西。



我建议你阅读这些文章:

< a href =http://msdn.microsoft.com/en-us/library/ms748948%28v=vs.110%29.aspx> WPF Windows概述 [ ^ ]

自定义Windows Presentation Foundation的控件 [ ^ ]

WPF和Windows窗体互操作 [ ^ ]



>根据窗口大小自动调整WPF窗口的高度! [ ^ ]
If i understand you well, you want to change the size of windows application, not the screen resolution. You want to achieve something similar to maximize mode in "normal" windows forms.

I would recommend you to read these articles:
WPF Windows Overview[^]
Customizing Controls For Windows Presentation Foundation[^]
WPF and Windows Forms Interoperation[^]

Adjust the height of the WPF window Automatically based on window size ![^]


在应用程序级别上不应该更改屏幕分辨率,因为它可能会破坏其他应用程序未经用户同意。用户和只有用户应该通过控制面板更改屏幕属性。



你应该开发你的,而不是试图做这种奇怪而不合法的事情。应用他们轻松采用任何屏幕尺寸的方式。对于一些想法,请参阅我过去的答案:

当屏幕分辨率发生变化时Zom Out出现故障 [ ^ ],

GUI外观 - C#.Net [ ^ ]。







你可以简单地最大化窗口大小或根据当前屏幕大小(以像素为单位)调整它:

http://msdn.microsoft.com/en-us/library/system.windows.window.windowstate%28v=vs.110%29 .aspx [ ^ ](至最大化/恢复等),

http://stackoverflow.com/questions/1927540/how-to-get-the-size-of-the-current-screen-in-wpf [ ^ ]。



-SA
Nothing should ever change screen resolution on the application level, as it can disrupt other application without the user consent. User and only the user should change screen properties, which is done through the control panel.

Instead of trying to do such weird and not legitimate thing, you should develop your application the way they easily adopt any screen size. For some ideas, please see my past answers:
Zom Out malfunctions when Screen resolution changes[^],
GUI Apperance - C#.Net[^].



You can simply maximize the window size or adjust it according to current the screen size in pixels:
http://msdn.microsoft.com/en-us/library/system.windows.window.windowstate%28v=vs.110%29.aspx[^] (to maximize/restore, etc.),
http://stackoverflow.com/questions/1927540/how-to-get-the-size-of-the-current-screen-in-wpf[^].

—SA


这篇关于如何在wpf应用程序中设置默认的全屏分辨率此应用程序在任何桌面分辨率下都会显示全屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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