本文介绍了对于MessageBox的按钮的文本更改语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想对MessageBox中的按钮文本是,说出来,俄语,法语等 - 比它在默认情况下在Windows中设置不同的语言。

I'd like to have text on buttons of MessageBox to be, say it, in russian, french, etc. - different language than it's set by default in Windows.

有没有办法做到这一点,而无需创建我的自定义提示消息框?

Is there any way to do it without creating my custom MessageBoxes?

推荐答案

避免在此花费大量的时间和精力。您的应用程序的用户总是会得到的消息框中她熟悉。它将显示匹配她的语言,很像视窗的其余部分的文本。有人说是俄语作为她的母语是不会需要切换到法国的飞行。如果她确实不那么她就已经购买了用于Windows的终极版,允许快速变化的Windows语言许可证。

Avoid spending a lot of time and energy on this. The user of your app will always get the message box she's familiar with. It will show the text that matches her language, much like the rest of Windows. Somebody that speaks Russian as her native language is not going to need to switch to French on the fly. If she actually does then she would have purchased a license for the Ultimate edition of Windows which permits changing the Windows language quickly.

您的应用程序将跟风,只要你不覆盖默认的文化,具有本地化您的应用程序。要注意的是重写UI线程的默认文化是做一个非常危险的事情,那.NET使用(或者你对这个问题)的线程池线程仍处于默认语言运行。这可能会导致因为不同的字符串比较规则很微妙的问题。例如,填充在一个线程一个排序列表会突然不能再在另一个线程排序,导致二进制搜索故障。

Your app will follow suit, as long as you don't override the default culture and have localized your app. Beware that overriding the default culture of the UI thread is a very dangerous thing to do, the threadpool threads that .NET uses (or you for that matter) still run in the default language. This can cause very subtle problems because of the different string comparison rules. For example, a SortedList filled in one thread will suddenly not be sorted anymore in another thread, causing a binary search to malfunction.

这篇关于对于MessageBox的按钮的文本更改语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 14:18