调整系统的dpi时控制调整大小 [英] Control resize when dpi of system is chenged

查看:83
本文介绍了调整系统的dpi时控制调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

由于这个原因,每当我将系统的dpi更改为DevEx组控件的125%时,控件内部的列表框也会被调整大小,并且不可见.

任何人都可以帮忙..提前谢谢

 

Developer_S

 

解决方案

要避免在较大的DPI上扩展WPF内容,您唯一可以做的就是检查应用程序系统DPI,并在找到非标准DPI时调整其内容的大小.这是检查DPI的方法

矩阵m =
PresentationSource.FromVisual(Application.Current.MainWindow).CompositionTarget.TransformToDevice;
double dx = m.M11;
double dy = m.M22;

(取自 http://blogs.msdn.com/jaimer/archive/2007/03/07/getting-system-dpi-in-wpf-app.aspx  )


Hi All,

 Whenever I change the dpi of my system to 125% the DevEx group control resize due to this reason the listbox inside the control is also resize and it is not visible.

Can anybody help..Thanks in advance

 

Developer_S

 

解决方案

The only thing you can do to avoid stretching WPF content on larger DPI, is to make your application check the system DPI and resize it's content when it finds non-standard DPI. Here's how to check the DPI

Matrix m =
PresentationSource.FromVisual(Application.Current.MainWindow).CompositionTarget.TransformToDevice;
double dx = m.M11;
double dy = m.M22;

(Taken from http://blogs.msdn.com/jaimer/archive/2007/03/07/getting-system-dpi-in-wpf-app.aspx )


这篇关于调整系统的dpi时控制调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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