形式的资源使用情况纲领性字符串? [英] Form resources usage for programmatic strings?

查看:130
本文介绍了形式的资源使用情况纲领性字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个基本的WinForm问题:默认情况下一个RESX文件是为每个窗体或用户控件创建(连同designer.cs)。这RESX正常工作的所有控件和文本通过用户界面添加到控制。

Had a basic WinForm question: By default a resx file is created for every form or user control (along with the designer.cs). This resx works fine for all the controls and the text added to the controls via the UI.

我在想,如果我可以用同样的RESX添加具有以编程方式使用,并根据条件字符串,连接到控制?请问RESX得到在任何情况下无效,该自定义字符串被删除? 什么是在这种情况下,遵循最佳实践?

I was wondering if I could use the same resx to add strings which have to be used programmatically and based on conditions, attached to the controls? Will the resx get overridden in any case and this custom strings be removed? What is the best practice to follow in this case?

推荐答案

自动生成的那些被覆盖(我使用的是2005),所以没有我不会使用相同的文件。我建议建立在你的项目中像这样.resx文件一个独立的区域。通常我创造每形成一个的.resx,配套课程的名称。

The auto-generated ones get overwritten (I'm using 2005), so no I would not use the same file. I would suggest creating a separate area in your project for .resx files like this. Usually I create one .resx per form, matching the name, of course.

编辑:这里是一个更详细的答案,我最近给组织文件/文件夹结构.resx文件本地化您的应用程序时。

Here is a more detailed answer I gave recently to organize the file/folder structure when localizing your app with .resx files.

这篇关于形式的资源使用情况纲领性字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆