本文介绍了如何禁用Elementhost(Winform控件)DPI感知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景

我们有一个由C ++实现的应用程序。某些MFC对话框包含winform activeX控件。在winform activeX控件中,有一个包含WPF内容的elementhost控件。

We have an application implemented by C++. Some of the MFC dialogs hold a winform activeX control. Inside the winform activeX control, there is an elementhost control which contains the WPF content.

问题

一切顺利直到应用程序在高DPI(150%)上运行。当DPI很高时,似乎Elementhost(或WPF)控件将执行自动缩放。虽然自动缩放会影响整个应用程序的行为。 

Everything goes well until the application is running on high DPI (150%). When DPI is high, it seems that Elementhost (or WPF) controls will do auto scaling. While the auto scaling will impact the behavior of the whole application. 

问题

我可以禁用自动元素主机控件或WPF控件的缩放?

Can I disable the auto scaling for elementhost control or WPF control?

我知道有一种方法可以禁用WPF应用程序的DPI感知,但我想要的是禁用用户控制DPI感知。我不想更改c ++应用程序设置。

I know there is a way to disable DPI awareness for WPF application, but what I want is to disable user control DPI awareness. I don't want to change the c++ application setting.

推荐答案


这篇关于如何禁用Elementhost(Winform控件)DPI感知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 02:25