开发者

how to translate buttons in DialogResult in compact framework?

开发者 https://www.devze.com 2023-04-04 06:20 出处:网络
DialogResult result = MessageBox.Show(\"Do you want to delete?\", string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
DialogResult result = MessageBox.Show("Do you want to delete?", string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);

            if (result == DialogResult.No)
            {
                return;
            }

And then i get popup Message with "Yes" and "No". Can开发者_如何学编程 i translate this two buttons and if yes how?

EDIT:

if anyone has similar problem look here:

http://www.christec.co.nz/blog/archives/134


No.

MessageBox.Show calls a native API function which shows a standard Windows dialog box.
The buttons will appear in the current system UI language.

If you want more control, create your own form.


If you're talking about the 'Yes'/'No' text in the popup, the text defaults to the local language set by the OS.

If you want to localize them to some other language, you'll have to implement your own MessageBox-like class.


On a computer with Russian language set a default UI language, your TextBox will display Da (Да) and Net (Нет) automatically instead of Yes and No. So basically you don't need to localize these.

P.S. Same applies to other UI localizations.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号