对在不同机器上改变大小的对话框字体感到困惑 [英] Confused about dialog fonts changing size on different machines

查看:62
本文介绍了对在不同机器上改变大小的对话框字体感到困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在对话框中使用大小为8的MS Shell Dlg字体。



我注意到对话框中的编辑和静态控件是在不同的机器上显示不同的字体

高度(两者都运行Win7)。例如。一台机器的高度为-13,另一台机器的高度为-11。



我正在试图找出造成这种变化的原因。
我认为默认启用DPI缩放。因此LOGPIXELSY应该在任何机器上返回相同的值。



我认为它只会使用所有子控件的整体对话框字体和大小。但它似乎正在为儿童控件挑选自己的尺寸。



关于导致这种情况的任何想法?另外,如何轻松地使所有对话框控件符合机器上一致的字体大小?我是否需要在每个对话框中为每个控件使用WM_SETFONT?



另一件事。有没有办法在不实际创建对话框的情况下说出编辑控件和静态控件的默认对话框字体?

I''m using the MS Shell Dlg font in size 8 in a dialog.

I''ve noticed that Edit and Static Controls in the dialog are displaying with a different font
height on different machines (both running Win7). E.g. with a height of -13 on one machine and a height of -11 on another machine.

I''m trying to figure out what is causing this change.
I thought that by default DPI scaling is enabled. Therefore LOGPIXELSY should return the same value on any machine.

I thought that it would just use the overall dialog font and size for all child controls. But it appears to be picking its own sizes for the child controls.

Any ideas on what is causing this? Also how can I easily make all dialog controls conform to a consistent font size accross machines? Do I need to use WM_SETFONT for every single control in every single dialog?

One other thing. Is there a way to get say the default dialog font for an edit control and a static control without actually creating a dialog?

推荐答案

以某种方式启用DPI感知。所以我发布了一个与此相关的单独的后续问题。
Somehow DPI awareness is getting enabled. So I''ve posted a seperate follow-up question related to this.


这篇关于对在不同机器上改变大小的对话框字体感到困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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