的WinForms字符串资源文件,连接起来的设计师字符串、设计师、文件、资源

2023-09-03 12:49:57 作者:噩梦占卜师

我试图本地化多语言WinForms应用程序。我试图找到一种方法来设置我的表单标签/按钮文本属性从资源文件中读取设计(而不是维持code,设置他们编程一大块)。

I'm trying to localise a WinForms app for multiple languages. I'm trying to find a way to set my form labels/buttons text properties to read from the resources file in the designer (rather than having to maintain a chunk of code that sets them programatically).

我发现我可以设置form.Localizable =真,但随后的资源是从旁边的表格文件中读取,但许多煤矿在多个表单共享。

I've found I can set form.Localizable=true, but then the resources are read from a file alongside the form, but many of mine are shared across multiple forms.

有什么办法来设置在设计师的标签的文字,存放在项目级的resx文件中的值?

Is there any way to set a label's text in the designer, to a value stored in a project-level resx file?

推荐答案

要回答这个问题,没有。

To answer the question, no.

但海事组织,这不应该做的反正,如果文本将是静态的。

But IMO, this should not be done anyways if the text will be static.

有一个读我的答案,本地化和资源: 资源字符串位置 Globalize在现有的Windows窗体应用程序 Using .resx文件的全局应用程序的消息

Have a read at my answers on localization and resources: Resource string location Globalize an existing Windows Forms application Using .resx files for global application messages