本文介绍了WPF:自定义区域设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天才发现WPF将忽略CultureInfo.CurrentCulture并始终使用en-US.在此处,我也找到了一个很好的答案.一切工作正常,直到其中一位用户自定义了区域设置以更改货币符号为止(在菲律宾,您可以编写Php和P,而大多数人更喜欢P,默认设置为Php).该应用程序似乎没有意识到这一点.有什么办法解决吗?

I just found out today that WPF will ignore CultureInfo.CurrentCulture and always use en-US. I have also found a wonderful answer here. Everything worked fine until one of the users customized the regional settings to change the currency symbol (here in the Philippines you could write Php and P and most people prefer P, the default setting is Php). The application doesn't seem to pick this up. Is there any way around this?

推荐答案

在对两个人进行了一周的研究之后,我认为目前无法使用Globalization类来做到这一点.

Well after a week's research of two people, I think there is currently no way of doing this using the Globalization classes.

CurrentUICulture和其他相关类包含所选语言的默认格式/设置,但不包含自定义设置.

CurrentUICulture and other related classes contain the default formats/settings for the selected Language but not the customized settings.

一种方法是直接从注册表项HKCU \ Control Panel \ International读取值.

One way to do this is by reading the values straight from the registry key, HKCU\Control Panel\International.

这篇关于WPF:自定义区域设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 22:20