WPF Windows程序以大字体显示,但只能在一台PC上显示 [英] WPF Windows program displays in large fonts but only on one PC

查看:78
本文介绍了WPF Windows程序以大字体显示,但只能在一台PC上显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WPF应用程序,它以比预期更大的尺寸显示字体.

I have a WPF application rendering fonts to a larger size than I expect.

问题在于,只有我编写的WPF应用程序似乎具有这种效果,并且该问题仅在一台计算机上发生.我编写的所有WPF程序(不仅是一个)都会产生这种效果,并且所有Windows都会产生这种效果.

The catch is that only WPF applications I write seem to have this effect, and the problem happens only on one computer. The effect also happens with all WPF programs I write (not just one), and all windows exhit the effect.

我正在将Visual Studio 2008与.NET 3.5 SP1配合使用;所有用WPF编写的程序.
操作系统是带有最新Service Pack的Windows XP.
屏幕分辨率为1680x1050.
Windows和使用Windows XP样式的按钮.
字体大小为正常.
DPI设置为常规尺寸(96 dpi).

I am using Visual Studio 2008 with .NET 3.5 SP1; all programs written in WPF.
The operating system is Windows XP with the latest service packs.
The screen resolution is 1680x1050.
Windows and buttons using Windows XP style.
Font size is Normal.
DPI setting is normal size (96 dpi).

我在其他两台具有相同操作系统和设置的计算机上测试了我的应用程序,看起来还不错.我的程序在其他数十台计算机上运行,​​但没有看到此问题.

I tested my applications on a two other computers with same OS and settings and it looks fine. My programs run on dozens of other computers and I do not see this problem.

这是一个看起来不错的窗口:

Here is a window that looks good:

这是一个显示问题的窗口(请注意左下方的按钮和字体大小):

Here is a window that shows the problem (notice the button on the lower left, and the font size):

我知道我可以增加宽度并增加余量来进行补偿,但是我需要了解为什么会这样. 我即将发布,我想确保我的用户看不到这种效果.

I know I can increase the width and add margin to compensate, but I need to understand why this happening. I am close to a release and I want to make sure my users do not see this effect.

赞赏所有想法.

推荐答案

我目前未在运行XP,但是我认为您可以通过显示属性"自定义出现在窗口标题(和按钮)中的文本的大小(我认为,右键单击桌面,选择属性",这是第3或第4个标签).它使您可以为所选项目选择颜色,窗口的背景色等.

I'm not running XP right now, but I thought you could customize the size of the text that appears in window captions (and buttons) via the Display Properties (right-click desktop, select Properties, and it's the 3rd or 4th tab, I think). It lets you select colors for selected items, background colors of windows, etc.

这与设置DPI设置是分开的.

That would be separate from setting the DPI settings.

这篇关于WPF Windows程序以大字体显示,但只能在一台PC上显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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