消息框按钮'与当前文化语言不同的语言
你好 我对 MessageBoxButtons 有一些奇怪的问题。
我用标准方式显示 MesssageBox
MessageBox.Show("Info","Info",MessageBoxButtons.YesNo,MessageBoxIcons.Warning);
问题是 YesNo 按钮是英文的,尽管 currentCulture 设置为其他语言 (pl-Pl)。控件的 Localized 属性设置为 true 并选择默认语言。然而,正如我之前提到的,messageBoxButtons 的语言与 currentCulture 的语言不同。 有什么办法可以解决这个问题吗?
Hi
I have strange problems with MessageBoxButtons.
I show MesssageBox with standar way
MessageBox.Show("Info","Info",MessageBoxButtons.YesNo,MessageBoxIcons.Warning);
The problem is that YesNo buttons are in english despite the fact that currentCulture is set to other language (pl-Pl). The controls Localizable property is set to true and the default language is chosen. However as I mentioned before I messageBoxButtons' language is different than language of currentCulture.
Is there any way to fix this ??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是设计使然,内置的 Windows 对话框(如 MessageBox)始终以系统默认语言显示文本。任何有兴趣以不同于 Windows 版本语言的语言运行计算机的用户都可以购买 Ultimate 版本的许可证。它支持可下载的语言包,可以更改所有 Windows 程序和对话框的语言文本。
否则这种情况并不常见,绝大多数用户只是购买与其母语相匹配的 Windows 版本。您唯一需要做的就是确保您的程序针对该语言进行了本地化。即使对于 Ultimate 也不需要在程序中支持按需切换,用户只需使用控制面板的区域和语言小程序即可进行切换。这会强制进行新的登录,从而确保您的程序重新启动。
This is by design, the built-in Windows dialogs (like MessageBox) always display text in the system default language. Any user that would be interested in running her machine in a language that's different from the Windows edition language would purchase a license to the Ultimate edition. Which supports downloadable language packs that can change the language text for all Windows programs and dialogs.
This is otherwise not very common, the vast majority of users just buy the Windows edition that matches their native language. The only thing you have to do is to ensure that your program is localized for that language. Even for Ultimate there is no need to support switching on demand in your program, the user simply uses Control Panel's Region and Language applet to switch. This forces a new login which in turn ensures that your program is restarted.
请参阅消息框按钮 - 设置语言?
See MessageBox buttons - set language?
此问题的另一个脚注:考虑以下情况,如果 Windows 设置为本地语言,但您的程序不支持该语言怎么办?现在,用户必须以一种精神分裂的方式接受消息框和其他系统级对话框,部分是英语,部分是母语。如果用户只希望程序是英文的怎么办?在现有的CurrentThread.CurrentUICulture属性方法下无法产生预期的效果。
把我的头靠在墙上一会儿,也许如果你读到这篇文章,它就不会发生在你身上......
基思
One other foot note to this issue: Consider the following, what if windows is setup for the local language, but your program doesn't support that language? Now the user must accept message boxes, and other system level dialogs in a schizophrenic sort of way, part English, part native language. What if the users wished to have the program only be in English? Under the existing CurrentThread.CurrentUICulture property methodology the desired effect can not be produced.
Beat my head against the wall for awhile on that one, maybe if you read this it won't happen to you...
Keith